OpenASIP
2.0
|
#include <InstructionReferenceImpl.hh>
Public Member Functions | |
InstructionReferenceImpl (TTAProgram::Instruction &ins, TTAProgram::InstructionReferenceManager &irm) | |
~InstructionReferenceImpl () | |
void | nullify () |
void | addRef (InstructionReference &ref) |
bool | removeRef (InstructionReference &ref) |
InstructionReferenceManager & | referencemanager () |
void | setInstruction (Instruction &ins) |
void | merge (InstructionReferenceImpl &other) |
Instruction & | instruction () |
unsigned int | count () |
const InstructionReference & | ref () |
Private Member Functions | |
InstructionReferenceImpl () | |
InstructionReferenceImpl (const InstructionReferenceImpl &) | |
Private Attributes | |
Instruction * | ins_ |
std::set< InstructionReference * > | refs_ |
InstructionReferenceManager * | refMan_ |
Definition at line 48 of file InstructionReferenceImpl.hh.
TTAProgram::InstructionReferenceImpl::InstructionReferenceImpl | ( | TTAProgram::Instruction & | ins, |
TTAProgram::InstructionReferenceManager & | irm | ||
) |
Constructor.
Stores the instruction and reference manager.
ins | Instruction whose references this will handle |
irm | the InstructionReferenceManager owning this object. |
Definition at line 60 of file InstructionReferenceImpl.cc.
TTAProgram::InstructionReferenceImpl::~InstructionReferenceImpl | ( | ) |
|
private |
|
private |
void TTAProgram::InstructionReferenceImpl::addRef | ( | InstructionReference & | ref | ) |
A new reference has been created for the instruction handled by this object. Adds it to the list.
InstructionReference | new reference. |
Definition at line 100 of file InstructionReferenceImpl.cc.
Referenced by TTAProgram::InstructionReference::InstructionReference(), TTAProgram::InstructionReference::operator=(), and TTAProgram::InstructionReference::setImpl().
|
inline |
|
inline |
Referenced by TTAProgram::InstructionReference::instruction().
void TTAProgram::InstructionReferenceImpl::merge | ( | InstructionReferenceImpl & | other | ) |
Merges another irimpl to this object.
Makes all of it's references to point into this instead. This will also indirectly lead to the deletion of the other. This is used for irm.update() when the new target ins already has a ref.
other | InstructionRefererenceImpl which to merge into this. |
Definition at line 134 of file InstructionReferenceImpl.cc.
References refs_.
Referenced by TTAProgram::InstructionReferenceManager::replace().
void TTAProgram::InstructionReferenceImpl::nullify | ( | ) |
Nullifies all references pointing to this.
This should only be called by instructionreferenec manager when removing zombie refs.
Definition at line 81 of file InstructionReferenceImpl.cc.
References refs_.
const InstructionReference & TTAProgram::InstructionReferenceImpl::ref | ( | ) |
Returns a reference pointing into instruction handled by this object.
Definition at line 161 of file InstructionReferenceImpl.cc.
References refs_.
Referenced by addRef(), and removeRef().
InstructionReferenceManager& TTAProgram::InstructionReferenceImpl::referencemanager | ( | ) |
bool TTAProgram::InstructionReferenceImpl::removeRef | ( | InstructionReference & | ref | ) |
A reference no longer points to instruction handled by this object.
Removes it from the list. If it was last, ask InstructionReferenceManager to delete this object.
ref | reference which no longer points here |
Definition at line 114 of file InstructionReferenceImpl.cc.
References assert, ins_, ref(), TTAProgram::InstructionReferenceManager::referenceDied(), refMan_, and refs_.
Referenced by TTAProgram::InstructionReference::operator=(), TTAProgram::InstructionReference::setImpl(), and TTAProgram::InstructionReference::~InstructionReference().
void TTAProgram::InstructionReferenceImpl::setInstruction | ( | Instruction & | ins | ) |
Sets this object to point into another instruction.
This method should be only called by InstructionReferenceManager.
ins | new insruction where to point. |
Definition at line 151 of file InstructionReferenceImpl.cc.
References ins_.
Referenced by TTAProgram::InstructionReferenceManager::replace().
|
private |
Definition at line 65 of file InstructionReferenceImpl.hh.
Referenced by removeRef(), and setInstruction().
|
private |
Definition at line 67 of file InstructionReferenceImpl.hh.
Referenced by removeRef().
|
private |
Definition at line 66 of file InstructionReferenceImpl.hh.
Referenced by addRef(), merge(), nullify(), ref(), removeRef(), and ~InstructionReferenceImpl().