coins.flow
Class BBlockHirImpl

java.lang.Object
  extended bycoins.flow.BBlockImpl
      extended bycoins.flow.BBlockHirImpl
All Implemented Interfaces:
BBlock, BBlockHir

public class BBlockHirImpl
extends BBlockImpl
implements BBlockHir

BBlockHirImpl Implements BBlock methods applicalble for HIR.


Field Summary
 
Fields inherited from class coins.flow.BBlockImpl
aflowBBlock, fAvailIn, fAvailOut, fBBlockNumber, fControlTransfer, fDbgLevel, fDef, fDefIn, fDefined, fDefNodes, fDefOut, fDominatedChildren, fEGen, fEKill, fEKillAll, fExpNodeListMap, fExposed, fFlagBox, fImmediateDominator, fImmediatePostDominator, fIn, fIrLink, fKill, fLiveIn, fLiveOut, flowRoot, fNextInDFO, fNextInInverseDFO, fOut, fPostDominatedChildren, fPredEdgeList, fPredList, fReach, fSuccEdgeList, fSuccList, fUsed, fWork, fWorkFA, subpFlow
 
Fields inherited from interface coins.flow.BBlock
HAS_CALL, HAS_JUMP, HAS_PTR_ASSIGN, HAS_STRUCT_UNION, IS_DELETED, IS_ENTRY, IS_EXIT, IS_MODIFIED, IS_RESTRUCTURED, LOOP_HEAD, LOOP_TAIL, UNDER_VISIT, USE_PTR, VISIT_OVER
 
Constructor Summary
BBlockHirImpl(FlowRoot pFlowRoot, LabeledStmt pLabeledStmt, int pBBlockNumber)
          Create new basic block corresponding to the HIR labeled statement pLabeledStmt.
 
Method Summary
 void addToExpNodeList(ExpId pExpId, HIR pExpNode)
          addToExpNodeList //##25 Add pExpNode to the list corresponding to pExpId to show that the expression for pExpId is computed at pExpNode.
 BBlockNodeIterator bblockNodeIterator()
          bblockNodeIterator Create an iterator to traverse all HIR nodes in this basic block.
 BBlockSubtreeIterator bblockSubtreeIterator()
          bblockSubtreeIterator Create an iterator to traverse all top-subtree in this basic block.
 java.util.List getExpNodeList(ExpId pExpId)
           
 Stmt getFirstStmt()
           
 IR getFirstSubtree()
          getFirstSubtree Get the first subtree contained in this block.
 Stmt getLastStmt()
           
 IR getLastSubtree()
          getLastSubtree Get the last subtree contained in this block.
 void printSubtrees()
          printSubtrees Print the sequence of subtrees contained in this block.
 void setIrLink(LabeledStmt pLabeledStmt)
          setIrLink Set HIR statement pLabeledStmt or LIR DefLabel subtree as the first top-subtree that starts this basic block.
 
Methods inherited from class coins.flow.BBlockImpl
addToPredList, addToSuccList, allocateSpaceForDataFlowAnalysis, controlTransfer, deleteFromPredList, deleteFromSuccList, getAflowBBlock, getAvailIn, getAvailInVector, getAvailOut, getAvailOutVector, getBBlockNumber, getBlockNumber, getDef, getDefIn, getDefined, getDefinedVector, getDefInVector, getDefNodes, getDefOut, getDefOutVector, getDefVector, getDominatedChildren, getEGen, getEGenVector, getEKill, getEKillAll, getEKillAllVector, getEKillVector, getExposed, getExposedVector, getFlag, getImmediateDominator, getImmediatePostDominator, getIrLink, getKill, getKillVector, getLabel, getLiveIn, getLiveInVector, getLiveOut, getLiveOutVector, getNextInDFO, getNextInInverseDFO, getPostDominatedChildren, getPredEdge, getPredList, getReach, getReachVector, getSubpFlow, getSuccEdge, getSuccList, getUsed, getUsedVector, getWork, getWorkFA, initiateFields, isAvailIn, isAvailOut, isDef, isDefIn, isDefined, isDefOut, isEGen, isEKill, isEntryBlock, isExitBlock, isExposed, isKill, isLiveIn, isLiveOut, isLoopBackEdge, isReach, isSymExpOn, isUsed, linkInDepthFirstOrder, linkInInverseDepthFirstOrder, resetForDataFlowAnal, setAflowBBlock, setAvailIn, setAvailOut, setDef, setDefIn, setDefined, setDefNodes, setDefOut, setDominatedChildren, setEGen, setEKill, setExposed, setFlag, setImmediateDominator, setImmediatePostDominator, setKill, setLiveIn, setLiveOut, setNextInDFO, setNextInInverseDFO, setPostDominatedChildren, setReach, setUsed, setWork, setWorkFA, toString, toStringDetail, toStringShort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface coins.flow.BBlock
addToPredList, addToSuccList, allocateSpaceForDataFlowAnalysis, controlTransfer, deleteFromPredList, deleteFromSuccList, getAflowBBlock, getAvailIn, getAvailOut, getBBlockNumber, getBlockNumber, getDef, getDefIn, getDefined, getDefNodes, getDefOut, getDominatedChildren, getEGen, getEKill, getEKillAll, getExposed, getFlag, getImmediateDominator, getImmediatePostDominator, getIrLink, getKill, getLabel, getLiveIn, getLiveOut, getNextInDFO, getNextInInverseDFO, getPostDominatedChildren, getPredEdge, getPredList, getReach, getSubpFlow, getSuccEdge, getSuccList, getUsed, getWork, getWorkFA, isAvailIn, isAvailOut, isDef, isDefIn, isDefined, isDefOut, isEGen, isEKill, isEntryBlock, isExitBlock, isExposed, isKill, isLiveIn, isLiveOut, isReach, isUsed, linkInDepthFirstOrder, linkInInverseDepthFirstOrder, setAflowBBlock, setDominatedChildren, setFlag, setImmediateDominator, setImmediatePostDominator, setNextInDFO, setNextInInverseDFO, setPostDominatedChildren, setWork, setWorkFA, toStringDetail, toStringShort
 

Constructor Detail

BBlockHirImpl

public BBlockHirImpl(FlowRoot pFlowRoot,
                     LabeledStmt pLabeledStmt,
                     int pBBlockNumber)
Create new basic block corresponding to the HIR labeled statement pLabeledStmt.

Method Detail

setIrLink

public void setIrLink(LabeledStmt pLabeledStmt)
Description copied from interface: BBlock
setIrLink Set HIR statement pLabeledStmt or LIR DefLabel subtree as the first top-subtree that starts this basic block.

Specified by:
setIrLink in interface BBlock
Overrides:
setIrLink in class BBlockImpl

bblockSubtreeIterator

public BBlockSubtreeIterator bblockSubtreeIterator()
Description copied from interface: BBlock
bblockSubtreeIterator Create an iterator to traverse all top-subtree in this basic block. All top-subtrees can be get by invoking next() for the iterator. The iterator skips such non-executable nodes as blockNode, listNode, stmtNode, ifNode, forNode, whileNode, untilNode, switchNode, labeledStmtNode with non-null Stmt body, and get executable statement body or expression under the skipped node. If a labeled statement has null statement body, it is not skipped.

Specified by:
bblockSubtreeIterator in interface BBlock
Overrides:
bblockSubtreeIterator in class BBlockImpl

bblockNodeIterator

public BBlockNodeIterator bblockNodeIterator()
Description copied from interface: BBlock
bblockNodeIterator Create an iterator to traverse all HIR nodes in this basic block. All nodes can be get by invoking next() for the iterator. To traverse executable node only, use nextExecutableNode() of the iterator (see BBlockNodeIterator interface).

Specified by:
bblockNodeIterator in interface BBlock
Overrides:
bblockNodeIterator in class BBlockImpl

getFirstSubtree

public IR getFirstSubtree()
Description copied from interface: BBlock
getFirstSubtree Get the first subtree contained in this block. The first subtree is the one that is traversed first by bblockSubtreeIterator.

Specified by:
getFirstSubtree in interface BBlock
Returns:
the non-null first subtree of IR nodes contained in this block. If there is no non-null subtree, return null.

getLastSubtree

public IR getLastSubtree()
Description copied from interface: BBlock
getLastSubtree Get the last subtree contained in this block. The last subtree is the one that is traversed last by bblockSubtreeIterator.

Specified by:
getLastSubtree in interface BBlock
Returns:
the non-null last subtree of IR nodes contained in this block. If there is no non-null subtree, return null.

printSubtrees

public void printSubtrees()
printSubtrees Print the sequence of subtrees contained in this block. The order of print is the same as that of bblockSubtreeIterator. "this" is any basic block.

Overrides:
printSubtrees in class BBlockImpl

addToExpNodeList

public void addToExpNodeList(ExpId pExpId,
                             HIR pExpNode)
addToExpNodeList //##25 Add pExpNode to the list corresponding to pExpId to show that the expression for pExpId is computed at pExpNode.

Parameters:
pExpId - ExpId for pExpNode.
pExpNode - Expression other than LHS of assignment.

getExpNodeList

public java.util.List getExpNodeList(ExpId pExpId)

getFirstStmt

public Stmt getFirstStmt()
Specified by:
getFirstStmt in interface BBlockHir

getLastStmt

public Stmt getLastStmt()
Specified by:
getLastStmt in interface BBlockHir