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

#include <TerminalBasicBlockReference.hh>

Inheritance diagram for TTAProgram::TerminalBasicBlockReference:
Inheritance graph
Collaboration diagram for TTAProgram::TerminalBasicBlockReference:
Collaboration graph

Public Member Functions

 TerminalBasicBlockReference (const BasicBlock &bb)
 
virtual ~TerminalBasicBlockReference ()
 
virtual Terminalcopy () const
 
virtual bool equals (const Terminal &other) const
 
virtual SimValue value () const
 
virtual const BasicBlockbasicBlock () const
 
virtual bool isBasicBlockReference () 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 isInstructionAddress () const
 
virtual bool isImmediateRegister () const
 
virtual bool isGPR () const
 
virtual bool isFUPort () const
 
virtual bool isRA () const
 
virtual bool isProgramOperationReference () const
 
virtual bool isCodeSymbolReference () const
 
virtual bool isUniversalMachineRegister () const
 
virtual Address address () const
 
virtual const InstructionReferenceinstructionReference () const
 
virtual InstructionReferenceinstructionReference ()
 
virtual const TTAMachine::RegisterFileregisterFile () const
 
virtual const TTAMachine::ImmediateUnitimmediateUnit () const
 
virtual const TTAMachine::FunctionUnitfunctionUnit () 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 Attributes

const BasicBlockbb_
 

Additional Inherited Members

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

Detailed Description

Definition at line 42 of file TerminalBasicBlockReference.hh.

Constructor & Destructor Documentation

◆ TerminalBasicBlockReference()

TTAProgram::TerminalBasicBlockReference::TerminalBasicBlockReference ( const BasicBlock bb)

Definition at line 38 of file TerminalBasicBlockReference.cc.

39  :
41  SimValue(bb.startAddress().location(), WORD_BITWIDTH)),
42  bb_(&bb) {}

Referenced by copy().

◆ ~TerminalBasicBlockReference()

virtual TTAProgram::TerminalBasicBlockReference::~TerminalBasicBlockReference ( )
inlinevirtual

Definition at line 45 of file TerminalBasicBlockReference.hh.

45 {}

Member Function Documentation

◆ basicBlock()

virtual const BasicBlock& TTAProgram::TerminalBasicBlockReference::basicBlock ( ) const
inlinevirtual

Returns a reference to the basic block to which the immediate points.

Returns
A reference to the basic block to which the immediate points.

Reimplemented from TTAProgram::Terminal.

Definition at line 51 of file TerminalBasicBlockReference.hh.

51  {
52  return *bb_;
53  }

References bb_.

Referenced by TTAProgram::TerminalInstructionReference::equals().

◆ copy()

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

Creates an exact copy of the terminal and returns it.

Returns
A copy of the terminal.

Reimplemented from TTAProgram::TerminalImmediate.

Definition at line 45 of file TerminalBasicBlockReference.cc.

45  {
46  return new TerminalBasicBlockReference(*bb_); }

References bb_, and TerminalBasicBlockReference().

Here is the call graph for this function:

◆ equals()

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

Checks if terminals are equal.

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

Reimplemented from TTAProgram::TerminalImmediate.

Definition at line 49 of file TerminalBasicBlockReference.cc.

49  {
50  const TerminalBasicBlockReference* otherBBRef =
51  dynamic_cast<const TerminalBasicBlockReference*>(&other);
52  if (otherBBRef) {
53  return otherBBRef->bb_ == bb_;
54  }
55 
56  const TerminalInstructionReference* otherInsRef =
57  dynamic_cast<const TerminalInstructionReference*>(&other);
58  if (otherInsRef) {
59  return &otherInsRef->instructionReference().instruction() ==
60  &(bb_->firstInstruction());
61  }
62  return false;
63 }

References bb_, TTAProgram::CodeSnippet::firstInstruction(), TTAProgram::InstructionReference::instruction(), and TTAProgram::TerminalInstructionReference::instructionReference().

Here is the call graph for this function:

◆ isBasicBlockReference()

virtual bool TTAProgram::TerminalBasicBlockReference::isBasicBlockReference ( ) const
inlinevirtual

Tells whether the terminal is reference to a basic block.

Returns
True if the terminal is a ref to a basic block

Reimplemented from TTAProgram::Terminal.

Definition at line 54 of file TerminalBasicBlockReference.hh.

54 { return true; }

◆ value()

SimValue TTAProgram::TerminalBasicBlockReference::value ( ) const
virtual

Returns the value of the inline immediate.

Returns
The value of the inline immediate.
Exceptions
WrongSubclassnever.

Reimplemented from TTAProgram::TerminalImmediate.

Definition at line 66 of file TerminalBasicBlockReference.cc.

66  {
68 }

References bb_, TTAProgram::Address::location(), TTAProgram::CodeSnippet::startAddress(), and WORD_BITWIDTH.

Here is the call graph for this function:

Member Data Documentation

◆ bb_

const BasicBlock* TTAProgram::TerminalBasicBlockReference::bb_
private

Definition at line 56 of file TerminalBasicBlockReference.hh.

Referenced by basicBlock(), copy(), equals(), and value().


The documentation for this class was generated from the following files:
TTAProgram::CodeSnippet::firstInstruction
virtual Instruction & firstInstruction() const
Definition: CodeSnippet.cc:216
TTAProgram::TerminalImmediate::TerminalImmediate
TerminalImmediate(SimValue value)
Definition: TerminalImmediate.cc:48
TTAProgram::CodeSnippet::startAddress
virtual Address startAddress() const
Definition: CodeSnippet.cc:780
TTAProgram::TerminalBasicBlockReference::bb_
const BasicBlock * bb_
Definition: TerminalBasicBlockReference.hh:56
SimValue
Definition: SimValue.hh:96
TTAProgram::TerminalBasicBlockReference::TerminalBasicBlockReference
TerminalBasicBlockReference(const BasicBlock &bb)
Definition: TerminalBasicBlockReference.cc:38
TTAProgram::Address::location
InstructionAddress location() const
WORD_BITWIDTH
const Byte WORD_BITWIDTH
Definition: BaseType.hh:138