OpenASIP
2.0
|
#include <CodeLabel.hh>
Public Member Functions | |
CodeLabel (const InstructionReference &ins, std::string name) | |
CodeLabel (const Procedure &proc) | |
virtual | ~CodeLabel () |
virtual Address | address () const |
const InstructionReference | instructionReference () const |
const Procedure & | procedure () const |
Public Member Functions inherited from TTAProgram::Label | |
virtual | ~Label () |
std::string | name () const |
const Scope & | scope () const |
void | setAddress (Address address) |
Private Attributes | |
const InstructionReference | ins_ |
Reference to instruction corresponding to this label. More... | |
const Procedure * | proc_ |
Procedure corresponding to this label. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from TTAProgram::Label | |
Label () | |
Label (const std::string &name, Address address, const Scope &scope) | |
void | setName (const std::string &name) |
void | setScope (const Scope &scope) |
A symbolic name that stands for a location in the program.
Definition at line 49 of file CodeLabel.hh.
TTAProgram::CodeLabel::CodeLabel | ( | const InstructionReference & | ins, |
std::string | name | ||
) |
Constructor.
Registers this label to the owning scope.
ins | Instruction corresponding to this label. |
name | Name of the label. Must be unique within the owning scope. |
IllegalRegistration | if the given instruction does not belong to a procedure, or its parent procedure does not belong to a program. |
Definition at line 61 of file CodeLabel.cc.
References TTAProgram::Instruction::address(), TTAProgram::Program::globalScope(), TTAProgram::InstructionReference::instruction(), TTAProgram::Label::name(), TTAProgram::CodeSnippet::parent(), TTAProgram::Instruction::parent(), proc_, TTAProgram::Label::setAddress(), TTAProgram::Label::setName(), and TTAProgram::Label::setScope().
TTAProgram::CodeLabel::CodeLabel | ( | const Procedure & | proc | ) |
An alternative constructor that takes the procedure.
proc | Procedure corresponding to this label |
IllegalRegistration | if the given procedure does not belong to a program. |
Definition at line 79 of file CodeLabel.cc.
References TTAProgram::Program::globalScope(), TTAProgram::Procedure::name(), TTAProgram::CodeSnippet::parent(), TTAProgram::Label::setAddress(), TTAProgram::Label::setName(), TTAProgram::Label::setScope(), and TTAProgram::CodeSnippet::startAddress().
|
virtual |
|
virtual |
Returns the address of the instruction or procedure corresponding to this label.
Reimplemented from TTAProgram::Label.
Definition at line 101 of file CodeLabel.cc.
References TTAProgram::Instruction::address(), ins_, TTAProgram::NullInstruction::instance(), TTAProgram::InstructionReference::instruction(), proc_, and TTAProgram::CodeSnippet::startAddress().
Referenced by TTAProgram::GlobalScope::copyAndRelocate(), TTAProgram::ProgramWriter::createBinary(), DisassemblyGridTable::loadProgram(), and SimControlLanguageCommand::parseInstructionAddressExpression().
const InstructionReference TTAProgram::CodeLabel::instructionReference | ( | ) | const |
Returns a reference to the instruction corresponding to this label.
IllegalRegistration | if the label points to a procedure that has no instructions. |
Definition at line 117 of file CodeLabel.cc.
References TTAProgram::InstructionReferenceManager::createReference(), TTAProgram::CodeSnippet::firstInstruction(), ins_, TTAProgram::NullInstruction::instance(), TTAProgram::InstructionReference::instruction(), TTAProgram::CodeSnippet::instructionCount(), TTAProgram::Program::instructionReferenceManager(), TTAProgram::CodeSnippet::parent(), and proc_.
const Procedure & TTAProgram::CodeLabel::procedure | ( | ) | const |
Return the procedure that contains this label.
IllegalRegistration | if the label is not registered in a procedure. |
Definition at line 136 of file CodeLabel.cc.
References assert, ins_, TTAProgram::InstructionReference::instruction(), TTAProgram::Instruction::parent(), and proc_.
|
private |
Reference to instruction corresponding to this label.
Definition at line 63 of file CodeLabel.hh.
Referenced by address(), instructionReference(), and procedure().
|
private |
Procedure corresponding to this label.
Definition at line 65 of file CodeLabel.hh.
Referenced by address(), CodeLabel(), instructionReference(), and procedure().