OpenASIP
2.0
|
#include <InstructionReference.hh>
Public Member Functions | |
InstructionReference (InstructionReferenceImpl *impl) | |
InstructionReference (const InstructionReference &ir) | |
virtual | ~InstructionReference () |
InstructionReference & | operator= (const InstructionReference &) |
Instruction & | instruction () const |
bool | setImpl (InstructionReferenceImpl *impl) |
bool | operator== (const InstructionReference &other) const |
Private Attributes | |
InstructionReferenceImpl * | impl_ |
Represents a reference to an Instruction instance.
The target of the reference can be changed as needed.
Definition at line 49 of file InstructionReference.hh.
|
explicit |
Constructor.
ins | Referred instruction. |
Definition at line 51 of file InstructionReference.cc.
References TTAProgram::InstructionReferenceImpl::addRef(), and impl_.
TTAProgram::InstructionReference::InstructionReference | ( | const InstructionReference & | ref | ) |
Constructor.
ins | Referred instruction. |
Definition at line 65 of file InstructionReference.cc.
References TTAProgram::InstructionReferenceImpl::addRef(), and impl_.
|
virtual |
Destructor.
Tells the impl that we are no longer pointing to it. It may get also deleted if this was the last reference to it.
Definition at line 103 of file InstructionReference.cc.
References impl_, and TTAProgram::InstructionReferenceImpl::removeRef().
Instruction & TTAProgram::InstructionReference::instruction | ( | ) | const |
Returns the referred instruction.
Definition at line 138 of file InstructionReference.cc.
References impl_, TTAProgram::NullInstruction::instance(), and TTAProgram::InstructionReferenceImpl::instruction().
Referenced by TTAProgram::TerminalInstructionReference::address(), TTAProgram::CodeLabel::address(), TTAProgram::CodeLabel::CodeLabel(), ControlFlowGraph::computeLeadersFromJumpSuccessors(), ProcedurePass::copyCfgToProcedure(), ControlFlowGraph::createBBEdges(), ControlFlowGraph::createJumps(), TTAProgram::DataInstructionAddressDef::destinationAddress(), POMDisassembler::disassemble(), TTAProgram::TerminalBasicBlockReference::equals(), TTAProgram::TerminalInstructionReference::equals(), TTAProgram::Program::fixInstructionReferences(), TTAProgram::CodeLabel::instructionReference(), ControlFlowGraph::jumpToBBN(), TTAProgram::CodeLabel::procedure(), and ControlFlowGraph::removeJumpToTarget().
InstructionReference & TTAProgram::InstructionReference::operator= | ( | const InstructionReference & | ref | ) |
Assignment operator.
Changes this reference to point to another instruction. Only changes this reference, not other references pointing to same instruction.
Definition at line 79 of file InstructionReference.cc.
References TTAProgram::InstructionReferenceImpl::addRef(), impl_, and TTAProgram::InstructionReferenceImpl::removeRef().
bool TTAProgram::InstructionReference::operator== | ( | const InstructionReference & | other | ) | const |
Definition at line 147 of file InstructionReference.cc.
References impl_.
bool TTAProgram::InstructionReference::setImpl | ( | InstructionReferenceImpl * | newImpl | ) |
Sets a new referred instruction.
The InstructionReferenceImpl is a "proxy object" that counts and keeps book of references
newImpl | New referred instruction. |
Definition at line 119 of file InstructionReference.cc.
References TTAProgram::InstructionReferenceImpl::addRef(), assert, impl_, and TTAProgram::InstructionReferenceImpl::removeRef().
|
private |
Definition at line 64 of file InstructionReference.hh.
Referenced by instruction(), InstructionReference(), operator=(), operator==(), setImpl(), and ~InstructionReference().