Public Member Functions

OA::CFG::CFGIRInterface Class Reference

#include <CFGIRInterface.hpp>

Inheritance diagram for OA::CFG::CFGIRInterface:
Inheritance graph
[legend]
Collaboration diagram for OA::CFG::CFGIRInterface:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CFGIRInterface ()
virtual ~CFGIRInterface ()
virtual OA_ptr
< IRRegionStmtIterator
procBody (ProcHandle h)=0
virtual bool returnStatementsAllowed ()=0
 Are return statements allowed.
virtual IRStmtType getCFGStmtType (StmtHandle h)=0
 Given a statement, return its CFG::IRStmtType.
virtual StmtLabel getLabel (StmtHandle h)=0
virtual OA_ptr
< IRRegionStmtIterator
getFirstInCompound (StmtHandle h)=0
virtual OA_ptr
< IRRegionStmtIterator
loopBody (StmtHandle h)=0
virtual StmtHandle loopHeader (StmtHandle h)=0
virtual StmtHandle getLoopIncrement (StmtHandle h)=0
 Given a loop statement, return the increment statement.
virtual bool loopIterationsDefinedAtEntry (StmtHandle h)=0
virtual OA_ptr
< IRRegionStmtIterator
trueBody (StmtHandle h)=0
virtual OA_ptr
< IRRegionStmtIterator
elseBody (StmtHandle h)=0
virtual int numMultiCases (StmtHandle h)=0
virtual OA_ptr
< IRRegionStmtIterator
multiBody (StmtHandle h, int bodyIndex)=0
virtual bool isBreakImplied (StmtHandle multicond)=0
virtual bool isCatchAll (StmtHandle h, int bodyIndex)=0
virtual OA_ptr
< IRRegionStmtIterator
getMultiCatchall (StmtHandle h)=0
virtual ExprHandle getSMultiCondition (StmtHandle h, int bodyIndex)=0
virtual StmtLabel getTargetLabel (StmtHandle h, int n)=0
virtual int numUMultiTargets (StmtHandle h)=0
virtual StmtLabel getUMultiTargetLabel (StmtHandle h, int targetIndex)=0
virtual StmtLabel getUMultiCatchallLabel (StmtHandle h)=0
virtual ExprHandle getUMultiCondition (StmtHandle h, int targetIndex)=0
virtual bool parallelWithSuccessor (StmtHandle h)=0
virtual int numberOfDelaySlots (StmtHandle h)=0

Detailed Description

The CFGIRInterface abstract base class gives a set of methods for manipulating a program. This is the primary interface to the underlying intermediate representation.

Definition at line 77 of file CFGIRInterface.hpp.


Constructor & Destructor Documentation

OA::CFG::CFGIRInterface::CFGIRInterface (  )  [inline]

Definition at line 79 of file CFGIRInterface.hpp.

virtual OA::CFG::CFGIRInterface::~CFGIRInterface (  )  [inline, virtual]

Definition at line 81 of file CFGIRInterface.hpp.


Member Function Documentation

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::elseBody ( StmtHandle  h  )  [pure virtual]

Given a structured two-way conditional statement, return an IRRegionStmtIterator for the "else" part (i.e., the statements under the "else" clause).

virtual IRStmtType OA::CFG::CFGIRInterface::getCFGStmtType ( StmtHandle  h  )  [pure virtual]

Given a statement, return its CFG::IRStmtType.

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::getFirstInCompound ( StmtHandle  h  )  [pure virtual]

Given a compound statement, return an IRRegionStmtIterator for the statements. A compound is a list of statements.

virtual StmtLabel OA::CFG::CFGIRInterface::getLabel ( StmtHandle  h  )  [pure virtual]

Given a statement, return a label (or StmtHandle(0) if there is no label associated with the statement).

virtual StmtHandle OA::CFG::CFGIRInterface::getLoopIncrement ( StmtHandle  h  )  [pure virtual]

Given a loop statement, return the increment statement.

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::getMultiCatchall ( StmtHandle  h  )  [pure virtual]

Given a structured multi-way branch, return an IRRegionStmtIterator for the body corresponding to default/catchall case.

virtual ExprHandle OA::CFG::CFGIRInterface::getSMultiCondition ( StmtHandle  h,
int  bodyIndex 
) [pure virtual]

Given a structured multi-way branch, return the condition expression corresponding to target 'bodyIndex'. The n targets are indexed [0..n-1].

virtual StmtLabel OA::CFG::CFGIRInterface::getTargetLabel ( StmtHandle  h,
int  n 
) [pure virtual]

Given an unstructured two-way branch, return the label of the target statement. The second parameter is currently unused.

virtual StmtLabel OA::CFG::CFGIRInterface::getUMultiCatchallLabel ( StmtHandle  h  )  [pure virtual]

Given an unstructured multi-way branch, return label of the target corresponding to the optional default/catchall case. Return 0 if there is no default target.

virtual ExprHandle OA::CFG::CFGIRInterface::getUMultiCondition ( StmtHandle  h,
int  targetIndex 
) [pure virtual]
virtual StmtLabel OA::CFG::CFGIRInterface::getUMultiTargetLabel ( StmtHandle  h,
int  targetIndex 
) [pure virtual]

Given an unstructured multi-way branch, return the label of the target statement at 'targetIndex'. The n targets are indexed [0..n-1].

virtual bool OA::CFG::CFGIRInterface::isBreakImplied ( StmtHandle  multicond  )  [pure virtual]

Given a structured multi-way branch, return true if the cases have implied break semantics. For example, this method would return false for C since one case will fall-through to the next if there is no explicit break statement. Matlab, on the other hand, implicitly exits the switch statement once a particular case has executed, so this method would return true.

virtual bool OA::CFG::CFGIRInterface::isCatchAll ( StmtHandle  h,
int  bodyIndex 
) [pure virtual]

Given a structured multi-way branch, return true if the body corresponding to target 'bodyIndex' is the default/catchall/ case.

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::loopBody ( StmtHandle  h  )  [pure virtual]

Given a loop statement, return an IRRegionStmtIterator for the loop body.

virtual StmtHandle OA::CFG::CFGIRInterface::loopHeader ( StmtHandle  h  )  [pure virtual]

Given a loop statement, return the loop header statement. This would be the initialization statement in a C 'for' loop, for example.

virtual bool OA::CFG::CFGIRInterface::loopIterationsDefinedAtEntry ( StmtHandle  h  )  [pure virtual]

Given a loop statement, return:

True: If the number of loop iterations is defined at loop entry (i.e. Fortran semantics). This causes the CFG builder to add the loop statement representative to the header node so that definitions from inside the loop don't reach the condition and increment specifications in the loop statement.

False: If the number of iterations is not defined at entry (i.e. C semantics), we add the loop statement to a node that is inside the loop in the CFG so definitions inside the loop will reach uses in the conditional test. For C style semantics, the increment itself may be a separate statement. if so, it will appear explicitly at the bottom of the loop.

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::multiBody ( StmtHandle  h,
int  bodyIndex 
) [pure virtual]

Given a structured multi-way branch, return an IRRegionStmtIterator for the body corresponding to target 'bodyIndex'. The n targets are indexed [0..n-1].

virtual int OA::CFG::CFGIRInterface::numberOfDelaySlots ( StmtHandle  h  )  [pure virtual]

Given an unstructured branch/jump statement, return the number of delay slots. Again, this would be used when the underlying IR is a low-level/assembly-level language for a VLIW or superscalar instruction set. The default implementation (which is appropriate for most IR's) is to return 0.

Implemented in OA::CFG::CFGIRInterfaceDefault.

virtual int OA::CFG::CFGIRInterface::numMultiCases ( StmtHandle  h  )  [pure virtual]

Given a structured multi-way branch, return the number of cases. The count does not include the default/catchall case.

virtual int OA::CFG::CFGIRInterface::numUMultiTargets ( StmtHandle  h  )  [pure virtual]

Given an unstructured multi-way branch, return the number of targets. The count does not include the optional default/catchall case.

virtual bool OA::CFG::CFGIRInterface::parallelWithSuccessor ( StmtHandle  h  )  [pure virtual]

Given a statement, return true if it issues in parallel with its successor. This would be used, for example, when the underlying IR is a low-level/assembly-level language for a VLIW or superscalar instruction set. The default implementation (which is appropriate for most IR's) is to return false.

Implemented in OA::CFG::CFGIRInterfaceDefault.

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::procBody ( ProcHandle  h  )  [pure virtual]

Given a ProcHandle, return an IRRegionStmtIterator* for the procedure.

virtual bool OA::CFG::CFGIRInterface::returnStatementsAllowed (  )  [pure virtual]

Are return statements allowed.

virtual OA_ptr<IRRegionStmtIterator> OA::CFG::CFGIRInterface::trueBody ( StmtHandle  h  )  [pure virtual]

Given a structured two-way conditional statement, return an IRRegionStmtIterator for the "true" part (i.e., the statements under the "if" clause).


The documentation for this class was generated from the following file: