coins.flow
Class BBlockImpl

java.lang.Object
  extended bycoins.flow.BBlockImpl
All Implemented Interfaces:
BBlock
Direct Known Subclasses:
BBlockHirImpl

public abstract class BBlockImpl
extends java.lang.Object
implements BBlock


Field Summary
protected  BBlock aflowBBlock
           
protected  ExpVector fAvailIn
           
protected  ExpVector fAvailOut
           
protected  int fBBlockNumber
           
 HIR fControlTransfer
           
 int fDbgLevel
           
protected  DefVector fDef
           
protected  FlowAnalSymVector fDefIn
           
protected  FlowAnalSymVector fDefined
           
protected  java.util.Set fDefNodes
           
protected  FlowAnalSymVector fDefOut
           
protected  java.util.LinkedList fDominatedChildren
           
protected  ExpVector fEGen
           
protected  ExpVector fEKill
           
protected  ExpVector fEKillAll
           
protected  java.util.HashMap fExpNodeListMap
           
protected  FlowAnalSymVector fExposed
           
protected  FlagBox fFlagBox
           
protected  BBlock fImmediateDominator
           
protected  BBlock fImmediatePostDominator
           
protected  DefVector fIn
           
protected  IR fIrLink
           
protected  DefVector fKill
           
protected  FlowAnalSymVector fLiveIn
           
protected  FlowAnalSymVector fLiveOut
           
 FlowRoot flowRoot
           
protected  BBlock fNextInDFO
           
protected  BBlock fNextInInverseDFO
           
protected  DefVector fOut
           
protected  java.util.LinkedList fPostDominatedChildren
           
protected  java.util.LinkedList fPredEdgeList
           
protected  java.util.LinkedList fPredList
           
protected  DefVector fReach
           
protected  java.util.LinkedList fSuccEdgeList
           
protected  java.util.LinkedList fSuccList
           
protected  FlowAnalSymVector fUsed
           
protected  java.lang.Object fWork
           
protected  java.lang.Object fWorkFA
           
 SubpFlow 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
BBlockImpl()
           
BBlockImpl(FlowRoot pFlowRoot, int pBBlockNumber)
          Create new basic block corresponding to the HIR labeled statement pLabeledStmt.
 
Method Summary
 void addToPredList(BBlock pPred)
          addToPredList addToSuccList Add the basic block pPred/pSucc to the list of predecessors/successors of this basic block, and this block is added to the list of successors/predecessors of pPred/pSucc.
 void addToSuccList(BBlock pSucc)
           
 void allocateSpaceForDataFlowAnalysis(int pPointCount, int pDefCount, int pExpCount)
           
 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.
 HIR controlTransfer()
          If this basic block ends with control transfer statement such as JUMP, RETURN, then this method returns the control transfer statement.
 void deleteFromPredList(BBlock pPred)
          deleteFromPredList deleteFromSuccList Delete the basic block pPred/pSucc from to the list of predecessors/successors of this basic block, and this block is deleted from the list of successors/predecessors of pPred/pSucc.
 void deleteFromSuccList(BBlock pSucc)
           
 BBlock getAflowBBlock()
           
 ExpVector getAvailIn()
          getAvailIn Get bit vector showing AvailIn set of this block.
 ExpVector getAvailInVector()
           
 ExpVector getAvailOut()
          getAvailOut Get bit vector showing AvailOut set of this block.
 ExpVector getAvailOutVector()
           
 int getBBlockNumber()
           
 int getBlockNumber()
          getBlockNumber Get the block number attached to this basic block.
 DefVector getDef()
          getDef Get bit vector showing Def set of this block.
 FlowAnalSymVector getDefIn()
          getDefIn Get bit vector showing DefIn set of this block.
 FlowAnalSymVector getDefined()
          getDefined Get bit vector showing Defined set of this block.
 FlowAnalSymVector getDefinedVector()
           
 FlowAnalSymVector getDefInVector()
           
 java.util.Set getDefNodes()
          getDefNodes Get the set of nodes defining a value.
 FlowAnalSymVector getDefOut()
          getDefOut Get bit vector showing DefOut set of this block.
 FlowAnalSymVector getDefOutVector()
           
 DefVector getDefVector()
           
 java.util.List getDominatedChildren()
          getDominatedChildren Get the list of basic blocks immediately dominated by this block.
 ExpVector getEGen()
          getEGen Get bit vector showing EGen set of this block.
 ExpVector getEGenVector()
           
 ExpVector getEKill()
          getEKill Get bit vector showing EKill set of this block.
 ExpVector getEKillAll()
          getEKillAll Get bit vector showing EKillAll set of this block.
 ExpVector getEKillAllVector()
           
 ExpVector getEKillVector()
           
 FlowAnalSymVector getExposed()
          getExposed Get bit vector showing Exposed set of this block.
 FlowAnalSymVector getExposedVector()
           
 boolean getFlag(int pFlagNumber)
          getFlag setFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber.
 BBlock getImmediateDominator()
          getImmediateDominator Get a basic block immediately dominating this block.
 BBlock getImmediatePostDominator()
          getImmediatePostDominator Get a basic block immediately post dominating this block.
 IR getIrLink()
          getIrLink Get the top-subtree that starts this basic block.
 DefVector getKill()
          getKill Get bit vector showing Kill set of this block.
 DefVector getKillVector()
           
 Label getLabel()
          getLabel Get a label attached to the first top-subtree of this basic block.
 FlowAnalSymVector getLiveIn()
          getLiveIn Get bit vector showing LiveIn set of this block.
 FlowAnalSymVector getLiveInVector()
           
 FlowAnalSymVector getLiveOut()
          getLiveOut Get bit vector showing LiveOut set of this block.
 FlowAnalSymVector getLiveOutVector()
           
 BBlock getNextInDFO()
          getNextInDFO Get the next BBlock in depth first order.
 BBlock getNextInInverseDFO()
          getNextInInverseDFO Get the next BBlock in inverse depth first order from exit BBlock.
 java.util.List getPostDominatedChildren()
          getPostDominatedChildren Get the list of basic blocks immediately post dominated by this block.
 Edge getPredEdge(BBlock pFromBBlock)
          getPredEdge Get the edge corresponding to the predecessor/successor to/from this basic block.
 java.util.List getPredList()
          getPredList Get the predecessor list of this basic block.
 DefVector getReach()
          getReach Get bit vector showing Reach set of this block.
 DefVector getReachVector()
           
 SubpFlow getSubpFlow()
          getUseNodes Get the set of nodes using value of variable or register.
 Edge getSuccEdge(BBlock pToBBlock)
          getSuccEdge Get the edge corresponding to the predecessor/successor to/from this basic block.
 java.util.List getSuccList()
          getSuccList Get the successor list of this basic block.
 FlowAnalSymVector getUsed()
          getUsed Get bit vector showing Used set of this block.
 FlowAnalSymVector getUsedVector()
           
 java.lang.Object getWork()
          getWork setWork get/set information privately used in each phase.
 java.lang.Object getWorkFA()
          getWorkFA setWorkFA get/set information privately used in flow analysis.
protected  void initiateFields()
           
 boolean isAvailIn(ExpId pExpId)
          isAvailIn See if the expression represented by pExpId is available (value is always computed) at entry to this block.
 boolean isAvailOut(ExpId pExpId)
          isAvailOut See if the expression represented by pExpId is available (value is always computed) at exit from this block.
 boolean isDef(int pPos)
          isDef See if definition at position pPos is done in this block.
 boolean isDefIn(Sym pSym)
          isDefIn See if pSym is always defined at entry to this block whichever path may be take.
 boolean isDefined(Sym pSym)
          isDefined See if the value of pSym is defined in this block.
 boolean isDefOut(Sym pSym)
          isDefOut See if pSym is always defined at exit from this block.
 boolean isEGen(ExpId pExpId)
          isEGen See if expression designated by pReg is generated (computed in this block and afterwards its operand is not changed) in this block.
 boolean isEKill(ExpId pExpId)
          isEKill See if expression designated by pReg is killed (its operand is defined) in this block.
 boolean isEntryBlock()
          isEntryBlock See if this block is the entry block in the graph of basic blocks.
 boolean isExitBlock()
          isExitBlock See if this block is the exit block in the graph of basic blocks.
 boolean isExposed(Sym pSym)
          isExposed See if the variable of pSym is used in this block without setting its value in this block.
 boolean isKill(int pPos)
          isKill See if definition at position pPos is killed in this block.
 boolean isLiveIn(Sym pSym)
          isLiveIn See if pSym is live at entry to this block (value at entry is used in this block or in some successor of this block).
 boolean isLiveOut(Sym pSym)
          isLiveOut See if pSym is live at exit from this block (value at exit is used in some successor of this block).
 boolean isLoopBackEdge(BBlock pPredecessor)
          isLoopBackEdge See if an edge is a loop back edge or not.
 boolean isReach(int pPos)
          isReach See if definition at position pPos reaches to the entry point of this block.
protected  boolean isSymExpOn(ExpVector pVector, Sym pSym)
          isSymExpOn Return true/false according to 1/0 of pVector bit corresponding to pSym.
 boolean isUsed(Sym pSym)
          isUsed See if the value of pSym is used in this block.
 void linkInDepthFirstOrder(Subp pSubp)
          linkInDepthFirstOrder(Subp pSubp) Link basic blocks of subprogram pSubp in depth first order starting from the entry BBlock.
 void linkInInverseDepthFirstOrder(Subp pSubp)
          linkInInverseDepthFirstOrder(Subp pSubp) Link basic blocks of subprogram pSubp in inverse depth first order starting from the exit BBlock.
 void printSubtrees()
          printSubtrees Print the sequence of subtrees contained in this block.
 void resetForDataFlowAnal()
           
 void setAflowBBlock(BBlock pBBlock)
           
 void setAvailIn(ExpVector pVect)
           
 void setAvailOut(ExpVector pVect)
           
 void setDef(DefVector pVect)
           
 void setDefIn(FlowAnalSymVector pVect)
           
 void setDefined(FlowAnalSymVector pVect)
           
 void setDefNodes(java.util.Set pSet)
           
 void setDefOut(FlowAnalSymVector pVect)
           
 void setDominatedChildren(java.util.LinkedList pDominatedChildren)
           
 void setEGen(ExpVector pVect)
           
 void setEKill(ExpVector pVect)
           
 void setExposed(FlowAnalSymVector pVect)
           
 void setFlag(int pFlagNumber, boolean pYesNo)
           
 void setImmediateDominator(BBlock pDominator)
           
 void setImmediatePostDominator(BBlock pPostDominator)
           
 void setIrLink(LabeledStmt pLabeledStmt)
          setIrLink Set HIR statement pLabeledStmt or LIR DefLabel subtree as the first top-subtree that starts this basic block.
 void setKill(DefVector pVect)
           
 void setLiveIn(FlowAnalSymVector pVect)
           
 void setLiveOut(FlowAnalSymVector pVect)
           
 void setNextInDFO(BBlock pNext)
          setNextInDFO Record the next BBlock in depth first order.
 void setNextInInverseDFO(BBlock pNext)
           
 void setPostDominatedChildren(java.util.LinkedList pPostDominatedChildren)
           
 void setReach(DefVector pVect)
           
 void setUsed(FlowAnalSymVector pVect)
           
 void setWork(java.lang.Object pWork)
          setWork get/set information privately used in each phase.
 void setWorkFA(java.lang.Object pWorkFA)
          getWorkFA setWorkFA get/set information privately used in flow analysis.
 java.lang.String toString()
           
 java.lang.String toStringDetail()
          toStringDetail
 java.lang.String toStringShort()
          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
getFirstSubtree, getLastSubtree
 

Field Detail

flowRoot

public final FlowRoot flowRoot

subpFlow

public final SubpFlow subpFlow

fBBlockNumber

protected int fBBlockNumber

fIrLink

protected IR fIrLink

fPredList

protected java.util.LinkedList fPredList

fSuccList

protected java.util.LinkedList fSuccList

fPredEdgeList

protected java.util.LinkedList fPredEdgeList

fSuccEdgeList

protected java.util.LinkedList fSuccEdgeList

fImmediateDominator

protected BBlock fImmediateDominator

fImmediatePostDominator

protected BBlock fImmediatePostDominator

fDominatedChildren

protected java.util.LinkedList fDominatedChildren

fPostDominatedChildren

protected java.util.LinkedList fPostDominatedChildren

fNextInDFO

protected BBlock fNextInDFO

fNextInInverseDFO

protected BBlock fNextInInverseDFO

fFlagBox

protected FlagBox fFlagBox

fWork

protected java.lang.Object fWork

fWorkFA

protected java.lang.Object fWorkFA

fExpNodeListMap

protected java.util.HashMap fExpNodeListMap

fDef

protected DefVector fDef

fKill

protected DefVector fKill

fIn

protected DefVector fIn

fOut

protected DefVector fOut

fReach

protected DefVector fReach

fEGen

protected ExpVector fEGen

fEKill

protected ExpVector fEKill

fEKillAll

protected ExpVector fEKillAll

fAvailIn

protected ExpVector fAvailIn

fAvailOut

protected ExpVector fAvailOut

fDefined

protected FlowAnalSymVector fDefined

fExposed

protected FlowAnalSymVector fExposed

fLiveIn

protected FlowAnalSymVector fLiveIn

fLiveOut

protected FlowAnalSymVector fLiveOut

fDefIn

protected FlowAnalSymVector fDefIn

fDefOut

protected FlowAnalSymVector fDefOut

fUsed

protected FlowAnalSymVector fUsed

fDefNodes

protected java.util.Set fDefNodes

fDbgLevel

public final int fDbgLevel

aflowBBlock

protected BBlock aflowBBlock

fControlTransfer

public HIR fControlTransfer
Constructor Detail

BBlockImpl

public BBlockImpl()

BBlockImpl

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

Method Detail

initiateFields

protected void initiateFields()

getBlockNumber

public int getBlockNumber()
Description copied from interface: BBlock
getBlockNumber Get the block number attached to this basic block.

Specified by:
getBlockNumber in interface BBlock
Returns:
the block number attached to this basic block.

getIrLink

public IR getIrLink()
Description copied from interface: BBlock
getIrLink Get the top-subtree that starts this basic block. See bblockSubtreeIterator or bblockNodeIterator for traversing top-subtrees or nodes in the basic block. See getLirTreeList for using LIRTreeListIterator. returned value of getIrLink is not applicable for LIRTreeListIterator.

Specified by:
getIrLink in interface BBlock
Returns:
LabeledStmt or DefLabel subtree that is the first top-subtree in this basic block.

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

getLabel

public Label getLabel()
Description copied from interface: BBlock
getLabel Get a label attached to the first top-subtree of this basic block.

Specified by:
getLabel in interface BBlock
Returns:
the label attached to the first top-subtree of this basic block. If multiple labels are attached, return the first one which show a relation with other blocks.

getPredList

public java.util.List getPredList()
Description copied from interface: BBlock
getPredList Get the predecessor list of this basic block. If this has no predecessor, empty list is returned. Elements of the list can be accessed by List methods. See ListIterator for traversing BBlocks in the predecessor/successor list.

Specified by:
getPredList in interface BBlock
Returns:
the predecessor list of this basic block.

getSuccList

public java.util.List getSuccList()
Description copied from interface: BBlock
getSuccList Get the successor list of this basic block. If this has no successor, empty list is returned. Elements of the list can be accessed by List methods. See ListIterator for traversing BBlocks in the successor list.

Specified by:
getSuccList in interface BBlock
Returns:
the successor list of this basic block.

getPredEdge

public Edge getPredEdge(BBlock pFromBBlock)
Description copied from interface: BBlock
getPredEdge Get the edge corresponding to the predecessor/successor to/from this basic block. getPredEdge Get the edge spanning from pFromBBlock to this. getSuccEdge Get the edge spanning from this to pToBBlock.

Specified by:
getPredEdge in interface BBlock

getSuccEdge

public Edge getSuccEdge(BBlock pToBBlock)
Description copied from interface: BBlock
getSuccEdge Get the edge corresponding to the predecessor/successor to/from this basic block. getPredEdge Get the edge spanning from pFromBBlock to this. getSuccEdge Get the edge spanning from this to pToBBlock.

Specified by:
getSuccEdge in interface BBlock

isEntryBlock

public boolean isEntryBlock()
isEntryBlock See if this block is the entry block in the graph of basic blocks.

Specified by:
isEntryBlock in interface BBlock
Returns:
true if this is the entry block in the graph of basic blocks, else return false.

isExitBlock

public boolean isExitBlock()
isExitBlock See if this block is the exit block in the graph of basic blocks.

Specified by:
isExitBlock in interface BBlock
Returns:
true if this is the exit block in the graph of basic blocks, else return false.

isLoopBackEdge

public boolean isLoopBackEdge(BBlock pPredecessor)
isLoopBackEdge See if an edge is a loop back edge or not.

Parameters:
pPredecessor - basic block contained in a basic block graph containing this block.
Returns:
true if the edge from pPredecessor to this block is a loop back edge, otherwise return false.

getImmediateDominator

public BBlock getImmediateDominator()
getImmediateDominator Get a basic block immediately dominating this block.

Specified by:
getImmediateDominator in interface BBlock
Returns:
the basic block immediately dominating this block.

setImmediateDominator

public void setImmediateDominator(BBlock pDominator)
Specified by:
setImmediateDominator in interface BBlock

getDominatedChildren

public java.util.List getDominatedChildren()
getDominatedChildren Get the list of basic blocks immediately dominated by this block. Elements of the list can be handled by List methods.

Specified by:
getDominatedChildren in interface BBlock
Returns:
the list of basic blocks immediately dominated by this block.

setDominatedChildren

public void setDominatedChildren(java.util.LinkedList pDominatedChildren)
Specified by:
setDominatedChildren in interface BBlock

getImmediatePostDominator

public BBlock getImmediatePostDominator()
getImmediatePostDominator Get a basic block immediately post dominating this block.

Specified by:
getImmediatePostDominator in interface BBlock
Returns:
the basic block immediately post dominating this block.

setImmediatePostDominator

public void setImmediatePostDominator(BBlock pPostDominator)
Specified by:
setImmediatePostDominator in interface BBlock

getPostDominatedChildren

public java.util.List getPostDominatedChildren()
getPostDominatedChildren Get the list of basic blocks immediately post dominated by this block. Elements of the list can be handled by List methods.

Specified by:
getPostDominatedChildren in interface BBlock
Returns:
the list of basic blocks immediately post dominated by this block.

setPostDominatedChildren

public void setPostDominatedChildren(java.util.LinkedList pPostDominatedChildren)
Specified by:
setPostDominatedChildren in interface BBlock

getNextInDFO

public BBlock getNextInDFO()
Description copied from interface: BBlock
getNextInDFO Get the next BBlock in depth first order. Before calling getNextInDFO, call linkInDepthFirstOrder.

Specified by:
getNextInDFO in interface BBlock

setNextInDFO

public void setNextInDFO(BBlock pNext)
Description copied from interface: BBlock
setNextInDFO Record the next BBlock in depth first order.

Specified by:
setNextInDFO in interface BBlock
Parameters:
pNext - Next BBlock in depth first order. This method is called in linkInDepthFirstOrder.

getNextInInverseDFO

public BBlock getNextInInverseDFO()
Description copied from interface: BBlock
getNextInInverseDFO Get the next BBlock in inverse depth first order from exit BBlock. /** setNextInInverseDFO: Set the next BBlock in inverse depth first order from exit BBlock.

Specified by:
getNextInInverseDFO in interface BBlock

setNextInInverseDFO

public void setNextInInverseDFO(BBlock pNext)
Specified by:
setNextInInverseDFO in interface BBlock

linkInDepthFirstOrder

public void linkInDepthFirstOrder(Subp pSubp)
Description copied from interface: BBlock
linkInDepthFirstOrder(Subp pSubp) Link basic blocks of subprogram pSubp in depth first order starting from the entry BBlock.

Specified by:
linkInDepthFirstOrder in interface BBlock

linkInInverseDepthFirstOrder

public void linkInInverseDepthFirstOrder(Subp pSubp)
Description copied from interface: BBlock
linkInInverseDepthFirstOrder(Subp pSubp) Link basic blocks of subprogram pSubp in inverse depth first order starting from the exit BBlock.

Specified by:
linkInInverseDepthFirstOrder in interface BBlock

getWork

public java.lang.Object getWork()
Description copied from interface: BBlock
getWork setWork get/set information privately used in each phase.

Specified by:
getWork in interface BBlock

setWork

public void setWork(java.lang.Object pWork)
Description copied from interface: BBlock
setWork get/set information privately used in each phase.

Specified by:
setWork in interface BBlock

getWorkFA

public java.lang.Object getWorkFA()
Description copied from interface: BBlock
getWorkFA setWorkFA get/set information privately used in flow analysis.

Specified by:
getWorkFA in interface BBlock

setWorkFA

public void setWorkFA(java.lang.Object pWorkFA)
Description copied from interface: BBlock
getWorkFA setWorkFA get/set information privately used in flow analysis.

Specified by:
setWorkFA in interface BBlock

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
Returns:
the BBlockSubtree iterator for this BBlock.

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
Returns:
the node iterator for this BBlock.

toString

public java.lang.String toString()

toStringShort

public java.lang.String toStringShort()
Description copied from interface: BBlock
toStringShort

Specified by:
toStringShort in interface BBlock
Returns:
Basic block number and predecessor/successor list.

toStringDetail

public java.lang.String toStringDetail()
Description copied from interface: BBlock
toStringDetail

Specified by:
toStringDetail in interface BBlock
Returns:
toStringShort(), linked node, and flags.

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.


addToPredList

public void addToPredList(BBlock pPred)
addToPredList addToSuccList Add the basic block pPred/pSucc to the list of predecessors/successors of this basic block, and this block is added to the list of successors/predecessors of pPred/pSucc.

Specified by:
addToPredList in interface BBlock
Parameters:
pPred - basic block to be added to the predecessor list of this basic block.

addToSuccList

public void addToSuccList(BBlock pSucc)
Specified by:
addToSuccList in interface BBlock

deleteFromPredList

public void deleteFromPredList(BBlock pPred)
deleteFromPredList deleteFromSuccList Delete the basic block pPred/pSucc from to the list of predecessors/successors of this basic block, and this block is deleted from the list of successors/predecessors of pPred/pSucc.

Specified by:
deleteFromPredList in interface BBlock
Parameters:
pPred - basic block to be deleted from the predecessor list of this basic block.

deleteFromSuccList

public void deleteFromSuccList(BBlock pSucc)
Specified by:
deleteFromSuccList in interface BBlock

getFlag

public boolean getFlag(int pFlagNumber)
Description copied from interface: BBlock
getFlag setFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber. setFlag sets the flag of specified number.

Specified by:
getFlag in interface BBlock
Parameters:
pFlagNumber - flag identification number (see below).

setFlag

public void setFlag(int pFlagNumber,
                    boolean pYesNo)
Specified by:
setFlag in interface BBlock

allocateSpaceForDataFlowAnalysis

public void allocateSpaceForDataFlowAnalysis(int pPointCount,
                                             int pDefCount,
                                             int pExpCount)
Specified by:
allocateSpaceForDataFlowAnalysis in interface BBlock

isDef

public boolean isDef(int pPos)
Description copied from interface: BBlock
isDef See if definition at position pPos is done in this block.

Specified by:
isDef in interface BBlock
Parameters:
pPos - position number attached to the definition node.
Returns:
true if the definition is done in this block, false otherwise.

isKill

public boolean isKill(int pPos)
Description copied from interface: BBlock
isKill See if definition at position pPos is killed in this block.

Specified by:
isKill in interface BBlock
Parameters:
pPos - position number attached to the definition node.
Returns:
true if the definition at pPos is killed in this block, false otherwise.

isReach

public boolean isReach(int pPos)
Description copied from interface: BBlock
isReach See if definition at position pPos reaches to the entry point of this block.

Specified by:
isReach in interface BBlock
Parameters:
pPos - position number attached to the definition node.
Returns:
true if the definition at pPos reaches to the entry point of this block, false otherwise.

isDefined

public boolean isDefined(Sym pSym)
Description copied from interface: BBlock
isDefined See if the value of pSym is defined in this block.

Specified by:
isDefined in interface BBlock
Parameters:
pSym - symbol representing a variable or a register or expression identifier.
Returns:
true if p(def(pSym)) is included in this block, false otherwise.

isUsed

public boolean isUsed(Sym pSym)
Description copied from interface: BBlock
isUsed See if the value of pSym is used in this block.

Specified by:
isUsed in interface BBlock
Parameters:
pSym - symbol representing a variable or a register or expression identifier.
Returns:
true if p(use(pSym)) is included in this block, false otherwise.

isExposed

public boolean isExposed(Sym pSym)
Description copied from interface: BBlock
isExposed See if the variable of pSym is used in this block without setting its value in this block.

Specified by:
isExposed in interface BBlock
Parameters:
pSym - symbol representing a variable or a register or expression identifier.
Returns:
true if pSym is used in this block and it is not set in this block before the use point.

isEGen

public boolean isEGen(ExpId pExpId)
Description copied from interface: BBlock
isEGen See if expression designated by pReg is generated (computed in this block and afterwards its operand is not changed) in this block.

Specified by:
isEGen in interface BBlock
Parameters:
pExpId - expression identifier assigned to the expression.
Returns:
true if the expression is generated in this block, false otherwise.

isEKill

public boolean isEKill(ExpId pExpId)
Description copied from interface: BBlock
isEKill See if expression designated by pReg is killed (its operand is defined) in this block.

Specified by:
isEKill in interface BBlock
Parameters:
pExpId - expression identifier assigned to the expression.
Returns:
true if the expression is killed in this block, false otherwise.

isAvailIn

public boolean isAvailIn(ExpId pExpId)
Description copied from interface: BBlock
isAvailIn See if the expression represented by pExpId is available (value is always computed) at entry to this block.

Specified by:
isAvailIn in interface BBlock
Parameters:
pExpId - expression identifier representing an expression. ()
Returns:
true if pExpId is available at entry to this block, false otherwise.

isAvailOut

public boolean isAvailOut(ExpId pExpId)
Description copied from interface: BBlock
isAvailOut See if the expression represented by pExpId is available (value is always computed) at exit from this block.

Specified by:
isAvailOut in interface BBlock
Parameters:
pExpId - expression identifier representing an expression. ()
Returns:
true if pExpId is available at exit from this block, false otherwise.

isLiveIn

public boolean isLiveIn(Sym pSym)
Description copied from interface: BBlock
isLiveIn See if pSym is live at entry to this block (value at entry is used in this block or in some successor of this block).

Specified by:
isLiveIn in interface BBlock
Parameters:
pSym - variable or register or expression identifier representing an expression.
Returns:
true if pSym is live at entry to this block, false otherwise.

isLiveOut

public boolean isLiveOut(Sym pSym)
Description copied from interface: BBlock
isLiveOut See if pSym is live at exit from this block (value at exit is used in some successor of this block).

Specified by:
isLiveOut in interface BBlock
Parameters:
pSym - variable or register or expression identifier representing an expression.
Returns:
true if pSym is live at exit from this block, false otherwise.

isDefIn

public boolean isDefIn(Sym pSym)
Description copied from interface: BBlock
isDefIn See if pSym is always defined at entry to this block whichever path may be take.

Specified by:
isDefIn in interface BBlock
Parameters:
pSym - variable or register or expression identifier representing an expression.
Returns:
true if pSym is always defined at entry to this block, false otherwise.

isDefOut

public boolean isDefOut(Sym pSym)
Description copied from interface: BBlock
isDefOut See if pSym is always defined at exit from this block.

Specified by:
isDefOut in interface BBlock
Parameters:
pSym - variable or register or expression identifier representing an expression.
Returns:
true if pSym is always defined at exit from this block, false otherwise.

isSymExpOn

protected boolean isSymExpOn(ExpVector pVector,
                             Sym pSym)
isSymExpOn Return true/false according to 1/0 of pVector bit corresponding to pSym. If pSym is ExpId, its index is used as pVector bit position. If pSym is Var, Param, Elem, then ExpId corresponding to pSym is taken and its index is used as the bit position.


getDef

public DefVector getDef()
Description copied from interface: BBlock
getDef Get bit vector showing Def set of this block.

Specified by:
getDef in interface BBlock
Returns:
bit vector representing Def(B) of this block B.

setDef

public void setDef(DefVector pVect)

getKill

public DefVector getKill()
Description copied from interface: BBlock
getKill Get bit vector showing Kill set of this block.

Specified by:
getKill in interface BBlock
Returns:
bit vector representing Kill(B) of this block B.

setKill

public void setKill(DefVector pVect)

getReach

public DefVector getReach()
Description copied from interface: BBlock
getReach Get bit vector showing Reach set of this block.

Specified by:
getReach in interface BBlock
Returns:
bit vector representing Reach(B) of this block B.

setReach

public void setReach(DefVector pVect)

getDefined

public FlowAnalSymVector getDefined()
Description copied from interface: BBlock
getDefined Get bit vector showing Defined set of this block.

Specified by:
getDefined in interface BBlock
Returns:
bit vector representing Defined(B) of this block B.

setDefined

public void setDefined(FlowAnalSymVector pVect)

getUsed

public FlowAnalSymVector getUsed()
Description copied from interface: BBlock
getUsed Get bit vector showing Used set of this block.

Specified by:
getUsed in interface BBlock
Returns:
bit vector representing Used(B) of this block B.

setUsed

public void setUsed(FlowAnalSymVector pVect)

getExposed

public FlowAnalSymVector getExposed()
Description copied from interface: BBlock
getExposed Get bit vector showing Exposed set of this block.

Specified by:
getExposed in interface BBlock
Returns:
bit vector representing Exposed(B) of this block B.

setExposed

public void setExposed(FlowAnalSymVector pVect)

getEGen

public ExpVector getEGen()
Description copied from interface: BBlock
getEGen Get bit vector showing EGen set of this block.

Specified by:
getEGen in interface BBlock
Returns:
bit vector representing EGen(B) of this block B.

setEGen

public void setEGen(ExpVector pVect)

getEKill

public ExpVector getEKill()
Description copied from interface: BBlock
getEKill Get bit vector showing EKill set of this block.

Specified by:
getEKill in interface BBlock
Returns:
bit vector representing EKill(B) of this block B.

getEKillAll

public ExpVector getEKillAll()
Description copied from interface: BBlock
getEKillAll Get bit vector showing EKillAll set of this block. EKillAll is cumulative set of expressions killed by some statements in this BBlock, that is, once an expression is killed by some staement, then it is included in EKillAll even if it is recomputed.

Specified by:
getEKillAll in interface BBlock
Returns:
bit vector representing EKillAll(B) of this block B.

setEKill

public void setEKill(ExpVector pVect)

getAvailIn

public ExpVector getAvailIn()
Description copied from interface: BBlock
getAvailIn Get bit vector showing AvailIn set of this block.

Specified by:
getAvailIn in interface BBlock
Returns:
bit vector representing AvailIn(B) of this block B.

setAvailIn

public void setAvailIn(ExpVector pVect)

getAvailOut

public ExpVector getAvailOut()
Description copied from interface: BBlock
getAvailOut Get bit vector showing AvailOut set of this block.

Specified by:
getAvailOut in interface BBlock
Returns:
bit vector representing AvailOut(B) of this block B.

setAvailOut

public void setAvailOut(ExpVector pVect)

getLiveIn

public FlowAnalSymVector getLiveIn()
Description copied from interface: BBlock
getLiveIn Get bit vector showing LiveIn set of this block.

Specified by:
getLiveIn in interface BBlock
Returns:
bit vector representing LiveIn(B) of this block B.

setLiveIn

public void setLiveIn(FlowAnalSymVector pVect)

getLiveOut

public FlowAnalSymVector getLiveOut()
Description copied from interface: BBlock
getLiveOut Get bit vector showing LiveOut set of this block.

Specified by:
getLiveOut in interface BBlock
Returns:
bit vector representing LiveOut(B) of this block B.

setLiveOut

public void setLiveOut(FlowAnalSymVector pVect)

getDefIn

public FlowAnalSymVector getDefIn()
Description copied from interface: BBlock
getDefIn Get bit vector showing DefIn set of this block.

Specified by:
getDefIn in interface BBlock
Returns:
bit vector representing DefIn(B) of this block B.

setDefIn

public void setDefIn(FlowAnalSymVector pVect)

getDefOut

public FlowAnalSymVector getDefOut()
Description copied from interface: BBlock
getDefOut Get bit vector showing DefOut set of this block.

Specified by:
getDefOut in interface BBlock
Returns:
bit vector representing DefOut(B) of this block B.

setDefOut

public void setDefOut(FlowAnalSymVector pVect)

getDefNodes

public java.util.Set getDefNodes()
Description copied from interface: BBlock
getDefNodes Get the set of nodes defining a value. To get each node in the set, see java.util.Set interface.

Specified by:
getDefNodes in interface BBlock
Returns:
the set of nodes that define a value of variable, etc.

setDefNodes

public void setDefNodes(java.util.Set pSet)

getSubpFlow

public SubpFlow getSubpFlow()
Description copied from interface: BBlock
getUseNodes Get the set of nodes using value of variable or register. To get each node in the set, see java.util.Set interface.

Specified by:
getSubpFlow in interface BBlock
Returns:
the set of nodes that uses value of variable, etc.

getBBlockNumber

public int getBBlockNumber()
Specified by:
getBBlockNumber in interface BBlock

setAflowBBlock

public void setAflowBBlock(BBlock pBBlock)
Specified by:
setAflowBBlock in interface BBlock

getAflowBBlock

public BBlock getAflowBBlock()
Specified by:
getAflowBBlock in interface BBlock

getReachVector

public DefVector getReachVector()

getDefVector

public DefVector getDefVector()

getKillVector

public DefVector getKillVector()

getEGenVector

public ExpVector getEGenVector()

getEKillVector

public ExpVector getEKillVector()

getEKillAllVector

public ExpVector getEKillAllVector()

getAvailInVector

public ExpVector getAvailInVector()

getAvailOutVector

public ExpVector getAvailOutVector()

getDefinedVector

public FlowAnalSymVector getDefinedVector()

getExposedVector

public FlowAnalSymVector getExposedVector()

getLiveInVector

public FlowAnalSymVector getLiveInVector()

getLiveOutVector

public FlowAnalSymVector getLiveOutVector()

getDefInVector

public FlowAnalSymVector getDefInVector()

getDefOutVector

public FlowAnalSymVector getDefOutVector()

getUsedVector

public FlowAnalSymVector getUsedVector()

resetForDataFlowAnal

public void resetForDataFlowAnal()

controlTransfer

public HIR controlTransfer()
Description copied from interface: BBlock
If this basic block ends with control transfer statement such as JUMP, RETURN, then this method returns the control transfer statement. If not, this method returns null.

Specified by:
controlTransfer in interface BBlock
Returns:
trailing control transfer statement if this BBlock ends with such statement.