coins.aflow
Class BBlockHirImpl
java.lang.Object
coins.aflow.BBlockImpl
coins.aflow.BBlockHirImpl
- All Implemented Interfaces:
- BBlock, BBlockHir
- public class BBlockHirImpl
- extends BBlockImpl
- implements BBlockHir
BBlockHirImpl:
Implements BBlock methods applicalble for HIR.
|
Field Summary |
protected java.util.Map |
fExpNodeListMap
fExpNodeListMap: //##25
key: ExpId, value: list of Ext nodes other than assignment. |
| Fields inherited from class coins.aflow.BBlockImpl |
fBBlockNumber, fIrLink, flowRoot, fNextInDFO, fNextInInverseDFO, fPredEdgeList, fPredList, fResults, fSuccEdgeList, fSuccList, fWork |
|
Method Summary |
void |
addEdge(Exp pConditionalExp,
BBlock pToBlock)
addEdge:
Add edge from this block to pToBlock that is to be taken
when pConditionalExp is true. |
void |
addSwitchCase(Const pConst,
Stmt pLabeledStmt)
addSwitchCase:
Add case selection part of switch statement contained in this
block and adjust linkages between basic blocks
(to change multiway jumps in HIR). |
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()
|
BBlockSubtreeIterator |
bblockSubtreeIterator()
bblockSubtreeIterator:
Create an iterator to traverse all top-subtree in this basic block. |
void |
deleteBBlock()
deleteBBlock:
Delete this block and add successors of this block to the set of
successors of all predecessors of this block. |
void |
deleteEdge(BBlock pToBlock)
deleteEdge:
Delete the edge from this block to pToBlock and adjust
related addresses and links so as to keep consistency. |
void |
deleteSwitchCase(Const pConst)
deleteSwitchCase: (##4)
Delete a case selection constant of switch statement contained
in this block. |
void |
fuseSuccessor(BBlock pToBlock)
fuseSuccessor:
Fuse the successor pToBlock with this block and make
all successors of pToBlock as successors of this block. |
java.util.List |
getExpNodeList(ExpId pExpId)
|
Stmt |
getFirstStmt()
|
Label |
getLabel()
getLabel:
Get a label attached to the first top-subtree of this basic block. |
Stmt |
getLastStmt()
|
void |
printSubtrees()
printSubtrees:
Print the sequence of subtrees contained in this block. |
void |
setIrLink(IR pIR)
Sets the LabeledStmt and Label associated with this BBlock. |
SetRefRepr |
setRefRepr(IR pIR)
Returns the SetRefRepr object enclosing the given IR. |
BBlock |
splitTailPart(Stmt pStmt)
|
| Methods inherited from class coins.aflow.BBlockImpl |
addToPredList, addToSuccList, changePredEdge, changeSuccEdge, deleteFromPredList, deleteFromSuccList, deleteFromSuccList0, getBBlockNumber, getDAvailIn, getDAvailOut, getDDef, getDDefIn, getDDefined, getDDefOut, getDef, getDEGen, getDExposed, getDKill, getDomForSubpFlow, getDominatedChildrenForSubpFlow, getDUsed, getImmediateDominatorForSubpFlow, getImmediatePostdominatorForSubpFlow, getIrLink, getNextInDFO, getNextInInverseDFO, getPDef, getPDefined, getPEKill, getPExposed, getPKill, getPLiveIn, getPLiveOut, getPostdomForSubpFlow, getPostdominatedChildrenForSubpFlow, getPReach, getPredEdge, getPredList, getPUsed, getReach, getSetRefReprs, getStrictDomForSubpFlow, getStrictPostdomForSubpFlow, getSubpFlow, getSuccEdge, getSuccList, getWork, initiateFields, insertConditionalInitPart, insertLoopPreheader, isDAvailIn, isDAvailOut, isDDef, isDDefIn, isDDefined, isDDefOut, isDEGen, isDExposed, isDKill, isDUsed, isEntryBBlock, isEntryBlock, isExitBBlock, isExitBlock, isPDef, isPDefined, isPEKill, isPExposed, isPKill, isPLiveIn, isPLiveOut, isPReach, isPUsed, results, setDAvailIn, setDAvailOut, setDDef, setDDefIn, setDDefined, setDDefOut, setDef, setDEGen, setDExposed, setDKill, setDomForSubpFlow, setDominatedChildrenForSubpFlow, setDReach, setDUsed, setImmediateDominatorForSubpFlow, setImmediatePostdominatorForSubpFlow, setNextInDFO, setNextInInveseDFO, setPDef, setPDefined, setPEKill, setPExposed, setPKill, setPLiveIn, setPLiveOut, setPostdomForSubpFlow, setPostdominatedChildrenForSubpFlow, setPReach, setPUsed, setReach, setSetRefReprs, setWork, toString, toStringDetail, toStringShort, toStringVeryShort |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface coins.aflow.BBlock |
addToPredList, addToSuccList, changePredEdge, changeSuccEdge, deleteFromPredList, deleteFromSuccList, getBBlockNumber, getDAvailIn, getDAvailOut, getDDefIn, getDDefined, getDDefOut, getDEGen, getDExposed, getDKill, getDomForSubpFlow, getDominatedChildrenForSubpFlow, getDUsed, getImmediateDominatorForSubpFlow, getImmediatePostdominatorForSubpFlow, getIrLink, getPDef, getPDefined, getPEKill, getPExposed, getPKill, getPLiveIn, getPLiveOut, getPostdomForSubpFlow, getPostdominatedChildrenForSubpFlow, getPReach, getPredEdge, getPredList, getPUsed, getSetRefReprs, getStrictDomForSubpFlow, getStrictPostdomForSubpFlow, getSubpFlow, getSuccEdge, getSuccList, getWork, isDAvailIn, isDAvailOut, isDDef, isDDefIn, isDDefined, isDDefOut, isDEGen, isDExposed, isDKill, isDUsed, isEntryBBlock, isExitBBlock, isPDef, isPDefined, isPEKill, isPExposed, isPKill, isPLiveIn, isPLiveOut, isPReach, isPUsed, results, setDAvailIn, setDAvailOut, setDDefIn, setDDefined, setDDefOut, setDEGen, setDExposed, setDKill, setDomForSubpFlow, setDominatedChildrenForSubpFlow, setDUsed, setImmediateDominatorForSubpFlow, setImmediatePostdominatorForSubpFlow, setPDef, setPDefined, setPEKill, setPExposed, setPKill, setPLiveIn, setPLiveOut, setPostdomForSubpFlow, setPostdominatedChildrenForSubpFlow, setPReach, setPUsed, setSetRefReprs, setWork, toStringDetail, toStringShort |
fExpNodeListMap
protected java.util.Map fExpNodeListMap
- fExpNodeListMap: //##25
key: ExpId, value: list of Ext nodes other than assignment.
BBlockHirImpl
protected BBlockHirImpl(LabeledStmt pLabeledStmt,
SubpFlow pSubpFlow)
setIrLink
public void setIrLink(IR pIR)
- Sets the
LabeledStmt and Label associated with this BBlock.
- 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.
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.
Using
SetRefReprIterator is the preferred method of iterating subtrees.
See SetRefReprIterator
- Specified by:
bblockSubtreeIterator in interface BBlock
- Returns:
- the BBlockSubtree iterator for this BBlock.
bblockNodeIterator
public BBlockNodeIterator bblockNodeIterator()
- Specified by:
bblockNodeIterator in interface BBlock
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
splitTailPart
public BBlock splitTailPart(Stmt pStmt)
addSwitchCase
public void addSwitchCase(Const pConst,
Stmt pLabeledStmt)
- addSwitchCase:
Add case selection part of switch statement contained in this
block and adjust linkages between basic blocks
(to change multiway jumps in HIR).
If basic blocks corresponding to pLabeledStmt of the case
selection part is not yet constructed, then they should be
constructed by divideIntoBBlocks before calling
addSwitchCase. (##4)
- Specified by:
addSwitchCase in interface BBlockHir
deleteSwitchCase
public void deleteSwitchCase(Const pConst)
- deleteSwitchCase: (##4)
Delete a case selection constant of switch statement contained
in this block. If all constants of a case selection statement
are deleted, then the case selection statement itself is also
deleted and linkages between basic blocks are adjusted
(to change multiway jumps in HIR).
- Specified by:
deleteSwitchCase in interface BBlockHir
addEdge
public void addEdge(Exp pConditionalExp,
BBlock pToBlock)
- Description copied from interface:
BBlock
- addEdge:
Add edge from this block to pToBlock that is to be taken
when pConditionalExp is true.
Branch addresses of this block and linkages between successors
of this block are changed so that consistency is kept.
"this" is a basic block having only one successor.
- Specified by:
addEdge in interface BBlock- Overrides:
addEdge in class BBlockImpl
deleteEdge
public void deleteEdge(BBlock pToBlock)
- deleteEdge:
Delete the edge from this block to pToBlock and adjust
related addresses and links so as to keep consistency.
If pToBlock has this block as its only one predecessor,
then pToBlock is deleted.
- Specified by:
deleteEdge in interface BBlock- Overrides:
deleteEdge in class BBlockImpl
deleteBBlock
public void deleteBBlock()
- deleteBBlock:
Delete this block and add successors of this block to the set of
successors of all predecessors of this block. Branch statement
or instructions in this block is moved to all predecessors of
this block so as to keep consistency.
"this" is a basic block whose predecessors have this block
as their only one successor. If the successors have more than
one successors, they should be modified before invoking
this method.
- Specified by:
deleteBBlock in interface BBlock- Overrides:
deleteBBlock in class BBlockImpl
fuseSuccessor
public void fuseSuccessor(BBlock pToBlock)
- fuseSuccessor:
Fuse the successor pToBlock with this block and make
all successors of pToBlock as successors of this block.
"this" is a basic block having pToBlock as its only one successor,
and pToBlock should have "this" as its only one predecessor.
Before invoking this method, this block should be changed
to have only one successor pToBlock if the condition is
not satisfied.
Branch addresses of this block and linkages between successors
of pToBlock are changed so that consistency is kept.
- Specified by:
fuseSuccessor in interface BBlock- Overrides:
fuseSuccessor in class BBlockImpl
setRefRepr
public SetRefRepr setRefRepr(IR pIR)
- Returns the
SetRefRepr object enclosing the given IR.
- Specified by:
setRefRepr in interface BBlock
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.
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