OpenASIP  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TTAProgram::TerminalInstructionReference Class Reference

#include <TerminalInstructionReference.hh>

Inheritance diagram for TTAProgram::TerminalInstructionReference:
Inheritance graph
Collaboration diagram for TTAProgram::TerminalInstructionReference:
Collaboration graph

Public Member Functions

 TerminalInstructionReference (InstructionReference ref)
 
virtual ~TerminalInstructionReference ()
 
virtual Address address () const
 
virtual const InstructionReferenceinstructionReference () const
 
virtual InstructionReferenceinstructionReference ()
 
virtual void setInstructionReference (InstructionReference ref)
 
virtual Terminalcopy () const
 
virtual bool equals (const Terminal &other) const
 
- Public Member Functions inherited from TTAProgram::TerminalInstructionAddress
 TerminalInstructionAddress ()
 
virtual ~TerminalInstructionAddress ()
 
bool isInstructionAddress () const
 
SimValue value () const
 
- Public Member Functions inherited from TTAProgram::TerminalImmediate
 TerminalImmediate (SimValue value)
 
virtual ~TerminalImmediate ()
 
virtual bool isImmediate () const
 
virtual TCEString toString () const
 
- Public Member Functions inherited from TTAProgram::Terminal
 Terminal ()
 
virtual ~Terminal ()
 
virtual bool isAddress () const
 
virtual bool isImmediateRegister () const
 
virtual bool isGPR () const
 
virtual bool isFUPort () const
 
virtual bool isRA () const
 
virtual bool isBasicBlockReference () const
 
virtual bool isProgramOperationReference () const
 
virtual bool isCodeSymbolReference () const
 
virtual bool isUniversalMachineRegister () const
 
virtual const TTAMachine::RegisterFileregisterFile () const
 
virtual const TTAMachine::ImmediateUnitimmediateUnit () const
 
virtual const TTAMachine::FunctionUnitfunctionUnit () const
 
virtual const BasicBlockbasicBlock () const
 
virtual int index () const
 
virtual bool isOpcodeSetting () const
 
virtual bool isTriggering () const
 
virtual Operationoperation () const
 
virtual OperationhintOperation () const
 
virtual int operationIndex () const
 
virtual const TTAMachine::Portport () const
 
virtual void setIndex (int index)
 
bool operator== (const Terminal &other) const
 
- Public Member Functions inherited from TTAProgram::AnnotatedInstructionElement
 AnnotatedInstructionElement ()
 
 ~AnnotatedInstructionElement ()
 
void addAnnotation (const ProgramAnnotation &annotation)
 
void setAnnotation (const ProgramAnnotation &annotation)
 
ProgramAnnotation annotation (int index, ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
 
int annotationCount (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
 
void removeAnnotations (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID)
 
bool hasAnnotations (ProgramAnnotation::Id id=ProgramAnnotation::ANN_UNDEF_ID) const
 
bool hasAnnotation (ProgramAnnotation::Id id, const TCEString &data) const
 
void copyAnnotationsFrom (const AnnotatedInstructionElement &other)
 

Private Member Functions

TerminalInstructionAddressoperator= (const TerminalInstructionAddress &)
 Assignment not allowed. More...
 

Private Attributes

InstructionReference ref_
 Referred instruction. More...
 

Additional Inherited Members

- Protected Attributes inherited from TTAProgram::TerminalImmediate
SimValue value_
 Value of the inline immediate. More...
 

Detailed Description

Represents an inline immediate that refers to an (absolute) instruction address via the InstructionReference indirection.

Definition at line 48 of file TerminalInstructionReference.hh.

Constructor & Destructor Documentation

◆ TerminalInstructionReference()

TTAProgram::TerminalInstructionReference::TerminalInstructionReference ( InstructionReference  ref)

The constructor.

Parameters
valueThe value of the inline immediate (the address).
spaceThe address space of the address the immediate refers to.
refThe instruction this address refers to.

Definition at line 51 of file TerminalInstructionReference.cc.

53 }

Referenced by copy().

◆ ~TerminalInstructionReference()

TTAProgram::TerminalInstructionReference::~TerminalInstructionReference ( )
virtual

The destructor.

Definition at line 58 of file TerminalInstructionReference.cc.

58  {
59 }

Member Function Documentation

◆ address()

Address TTAProgram::TerminalInstructionReference::address ( ) const
virtual

Returns the value of the immediate (instruction address).

Returns
The value of the immediate (instruction address).

Implements TTAProgram::TerminalInstructionAddress.

Definition at line 67 of file TerminalInstructionReference.cc.

67  {
68  return ref_.instruction().address();
69 }

References TTAProgram::Instruction::address(), TTAProgram::InstructionReference::instruction(), and ref_.

Here is the call graph for this function:

◆ copy()

Terminal * TTAProgram::TerminalInstructionReference::copy ( ) const
virtual

Creates an exact copy of the terminal and returns it.

Returns
A copy of the terminal.

Implements TTAProgram::TerminalInstructionAddress.

Definition at line 111 of file TerminalInstructionReference.cc.

111  {
113 }

References ref_, and TerminalInstructionReference().

Here is the call graph for this function:

◆ equals()

bool TTAProgram::TerminalInstructionReference::equals ( const Terminal other) const
virtual

Checks if terminals are equal.

Parameters
otherTerminal to compare.
Returns
true if terminals are equal.

Implements TTAProgram::TerminalInstructionAddress.

Definition at line 122 of file TerminalInstructionReference.cc.

122  {
123 
124  const TerminalBasicBlockReference* otherBBRef =
125  dynamic_cast<const TerminalBasicBlockReference*>(&other);
126  if (otherBBRef) {
127  const BasicBlock& bb = otherBBRef->basicBlock();
128  return &ref_.instruction() == &(bb.firstInstruction());
129  }
130 
131  const TerminalInstructionReference* otherInsRef =
132  dynamic_cast<const TerminalInstructionReference*>(&other);
133  if (otherInsRef) {
134  return otherInsRef->instructionReference() ==
135  ref_;
136  }
137  return false;
138 }

References TTAProgram::TerminalBasicBlockReference::basicBlock(), TTAProgram::CodeSnippet::firstInstruction(), TTAProgram::InstructionReference::instruction(), instructionReference(), and ref_.

Referenced by ControlFlowGraph::sanitize().

Here is the call graph for this function:

◆ instructionReference() [1/2]

virtual InstructionReference& TTAProgram::TerminalInstructionReference::instructionReference ( )
virtual

Reimplemented from TTAProgram::Terminal.

◆ instructionReference() [2/2]

InstructionReference & TTAProgram::TerminalInstructionReference::instructionReference ( ) const
virtual

Returns a reference to the instruction to which the immediate points.

Returns
A reference to the instruction to which the immediate points.
Exceptions
WrongSubclassnever.

Reimplemented from TTAProgram::Terminal.

Definition at line 78 of file TerminalInstructionReference.cc.

78  {
79  return ref_;
80 }

References ref_.

Referenced by ControlFlowGraph::createBBEdges(), TTAProgram::TerminalBasicBlockReference::equals(), equals(), and ControlFlowGraph::removeJumpToTarget().

◆ operator=()

TerminalInstructionAddress& TTAProgram::TerminalInstructionReference::operator= ( const TerminalInstructionAddress )
private

Assignment not allowed.

◆ setInstructionReference()

void TTAProgram::TerminalInstructionReference::setInstructionReference ( InstructionReference  ref)
virtual

Set a new referred instruction.

Parameters
refThe new instruction reference.
Exceptions
WrongSubclassnever.

Reimplemented from TTAProgram::Terminal.

Definition at line 100 of file TerminalInstructionReference.cc.

101  {
102  ref_ = ref;
103 }

References ref_.

Referenced by CopyingDelaySlotFiller::updateJumpsAndCfg().

Member Data Documentation

◆ ref_

InstructionReference TTAProgram::TerminalInstructionReference::ref_
private

Referred instruction.

Definition at line 64 of file TerminalInstructionReference.hh.

Referenced by address(), copy(), equals(), instructionReference(), and setInstructionReference().


The documentation for this class was generated from the following files:
TTAProgram::InstructionReference::instruction
Instruction & instruction() const
Definition: InstructionReference.cc:138
TTAProgram::TerminalInstructionReference::ref_
InstructionReference ref_
Referred instruction.
Definition: TerminalInstructionReference.hh:64
TTAProgram::TerminalInstructionAddress::TerminalInstructionAddress
TerminalInstructionAddress()
Definition: TerminalInstructionAddress.cc:48
TTAProgram::TerminalInstructionReference::TerminalInstructionReference
TerminalInstructionReference(InstructionReference ref)
Definition: TerminalInstructionReference.cc:51
TTAProgram::Instruction::address
Address address() const
Definition: Instruction.cc:327