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

#include <TerminalProgramOperation.hh>

Inheritance diagram for TTAProgram::TerminalProgramOperation:
Inheritance graph
Collaboration diagram for TTAProgram::TerminalProgramOperation:
Collaboration graph

Public Member Functions

 TerminalProgramOperation (TCEString instructionLabel)
 
 TerminalProgramOperation (ProgramOperationPtr po)
 
virtual ~TerminalProgramOperation ()
 
ProgramOperationPtr programOperation () const
 
void setProgramOperation (ProgramOperationPtr po)
 
bool isProgramOperationKnown () const
 
bool isProgramOperationReference () const
 
bool isAddressKnown () const
 
virtual Address address () const
 
virtual Terminalcopy () const
 
virtual bool equals (const Terminal &other) const
 
TCEString label () 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 isCodeSymbolReference () const
 
virtual bool isUniversalMachineRegister () const
 
virtual const InstructionReferenceinstructionReference () const
 
virtual InstructionReferenceinstructionReference ()
 
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)
 
virtual void setInstructionReference (InstructionReference ref)
 
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

TerminalProgramOperationoperator= (const TerminalProgramOperation &)
 Assignment not allowed. More...
 

Private Attributes

ProgramOperationPtr po_
 The referred PO. The pointer can be copied, e.g. to DDG. More...
 
TCEString label_
 

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 a program operation (a set of moves constituting a single execution of an operation in the program).

The returned instruction address is the one of the trigger move of the tracked ProgramOperation. This class is used to refer to the location of an another ProgramOperation strictly (not wanting to refer to the beginning of a BB).

Definition at line 51 of file TerminalProgramOperation.hh.

Constructor & Destructor Documentation

◆ TerminalProgramOperation() [1/2]

TTAProgram::TerminalProgramOperation::TerminalProgramOperation ( TCEString  label)

Constructs an incomplete TerminalProgramOperation.

This can be used when a TerminalProgramOperation might point to an non-existing PO during builing of the program.

Parameters
labelA textual label of the target PO. Should be used later to find the correct PO.

Definition at line 62 of file TerminalProgramOperation.cc.

63  :
65 }

Referenced by copy().

◆ TerminalProgramOperation() [2/2]

TTAProgram::TerminalProgramOperation::TerminalProgramOperation ( ProgramOperationPtr  po)

The constructor.

Parameters
poThe ProgramOperation to track.

Definition at line 48 of file TerminalProgramOperation.cc.

49  :
51 }

◆ ~TerminalProgramOperation()

TTAProgram::TerminalProgramOperation::~TerminalProgramOperation ( )
virtual

The destructor.

Definition at line 71 of file TerminalProgramOperation.cc.

71  {
72 }

Member Function Documentation

◆ address()

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

Returns the instruction address of the trigger move in the tracked ProgramOperation.

Returns 0 in case the target PO is not in a program, thus its address is not known.

Implements TTAProgram::TerminalInstructionAddress.

Definition at line 82 of file TerminalProgramOperation.cc.

82  {
84  return po_->triggeringMove()->move().parent().address();
85 }

References assert, isAddressKnown(), and po_.

Here is the call graph for this function:

◆ copy()

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

Creates an exact copy of the terminal and returns it.

Implements TTAProgram::TerminalInstructionAddress.

Definition at line 99 of file TerminalProgramOperation.cc.

99  {
101  newObj->label_ = this->label_;
102  return newObj;
103 }

References label_, po_, and TerminalProgramOperation().

Here is the call graph for this function:

◆ equals()

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

Checks if terminals are equal.

Implements TTAProgram::TerminalInstructionAddress.

Definition at line 109 of file TerminalProgramOperation.cc.

109  {
110 
111  if (!other.isInstructionAddress()) {
112  return false;
113  }
114  return &dynamic_cast<const TerminalProgramOperation&>(other).po_ ==
115  &this->po_;
116 }

References TTAProgram::Terminal::isInstructionAddress(), and po_.

Here is the call graph for this function:

◆ isAddressKnown()

bool TTAProgram::TerminalProgramOperation::isAddressKnown ( ) const

Definition at line 88 of file TerminalProgramOperation.cc.

88  {
89  return isProgramOperationKnown() &&
90  po_->triggeringMove() != NULL &&
91  po_->triggeringMove()->move().isInInstruction() &&
92  po_->triggeringMove()->move().parent().isInProcedure();
93 }

References isProgramOperationKnown(), and po_.

Referenced by address().

Here is the call graph for this function:

◆ isProgramOperationKnown()

bool TTAProgram::TerminalProgramOperation::isProgramOperationKnown ( ) const
inline

Definition at line 65 of file TerminalProgramOperation.hh.

65  {
66  return po_.get() != NULL;
67  }

References po_.

Referenced by llvm::LLVMTCEBuilder::fixProgramOperationReferences(), and isAddressKnown().

◆ isProgramOperationReference()

bool TTAProgram::TerminalProgramOperation::isProgramOperationReference ( ) const
inlinevirtual

Reimplemented from TTAProgram::Terminal.

Definition at line 69 of file TerminalProgramOperation.hh.

69 { return true; }

◆ label()

TCEString TTAProgram::TerminalProgramOperation::label ( ) const
inline

◆ operator=()

TerminalProgramOperation& TTAProgram::TerminalProgramOperation::operator= ( const TerminalProgramOperation )
private

Assignment not allowed.

◆ programOperation()

ProgramOperationPtr TTAProgram::TerminalProgramOperation::programOperation ( ) const
inline

Definition at line 57 of file TerminalProgramOperation.hh.

57  {
58  return po_;
59  }

References po_.

Referenced by ControlFlowGraph::buildMBBFromBB().

◆ setProgramOperation()

void TTAProgram::TerminalProgramOperation::setProgramOperation ( ProgramOperationPtr  po)
inline

Definition at line 61 of file TerminalProgramOperation.hh.

61  {
62  po_ = po;
63  }

References po_.

Referenced by llvm::LLVMTCEBuilder::fixProgramOperationReferences().

Member Data Documentation

◆ label_

TCEString TTAProgram::TerminalProgramOperation::label_
private

Definition at line 84 of file TerminalProgramOperation.hh.

Referenced by copy(), and label().

◆ po_

ProgramOperationPtr TTAProgram::TerminalProgramOperation::po_
private

The referred PO. The pointer can be copied, e.g. to DDG.

Definition at line 83 of file TerminalProgramOperation.hh.

Referenced by address(), copy(), equals(), isAddressKnown(), isProgramOperationKnown(), programOperation(), and setProgramOperation().


The documentation for this class was generated from the following files:
TTAProgram::TerminalProgramOperation::label_
TCEString label_
Definition: TerminalProgramOperation.hh:84
TTAProgram::TerminalProgramOperation::po_
ProgramOperationPtr po_
The referred PO. The pointer can be copied, e.g. to DDG.
Definition: TerminalProgramOperation.hh:83
TTAProgram::TerminalProgramOperation::isProgramOperationKnown
bool isProgramOperationKnown() const
Definition: TerminalProgramOperation.hh:65
assert
#define assert(condition)
Definition: Application.hh:86
TTAProgram::TerminalProgramOperation::isAddressKnown
bool isAddressKnown() const
Definition: TerminalProgramOperation.cc:88
TTAProgram::TerminalInstructionAddress::TerminalInstructionAddress
TerminalInstructionAddress()
Definition: TerminalInstructionAddress.cc:48
TTAProgram::TerminalProgramOperation::label
TCEString label() const
Definition: TerminalProgramOperation.hh:77
TTAProgram::TerminalProgramOperation::TerminalProgramOperation
TerminalProgramOperation(TCEString instructionLabel)
Definition: TerminalProgramOperation.cc:62