|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
BBlock interface
Interface for basic block class BBlock. Data flow analysis and basic control flow analysis are done based on the graph of basic blocks. All methods other than static ones are a method used for BBlock object ("this" is a BBlock instance). Structure of basic blocks: Input program represented in HIR or LIR is decomposed into basic blocks. Control flow of the program can be represented by a graph of basic blocks connected by predecessor/successor relation. Information of the basic block is represented by an object of BBlock class. A label definition in IR tree shows a link to BBlock object. An HIR statement node or LIR instruction node attached with label indicates the beginning of a new basic block. Contents of a basic block can be treated as a sequence of subtrees which may be either HIR subtree or LIR subtree. Such subtree is called a "top-subtree". The top-subtree of HIR may represent a part of statement or expression where some other part of the statement or expression may be included in different basic blocks. An HIR statement attached with label (LabeledStmt) starts a new basic block. If an HIR expression has label definition, it starts a new basic block. Depth first traversal of HIR tree from left to right represents a sequence of HIR nodes. In this traversal, if an HIR statement node is encountered, it starts a new top-subtree. If a top-subtree is an expression subtree and another expression subtree or statement subtree without label definition succeeds immediately after the top-subtree, then the succeeding subtree is treated as the next top-subtree. The LIR top-subtree represents an LIR instruction. In LIR flow analysis, a basic block is composed of a list of LIR top-subtees (LIR instructions). A label definition in LIR (DefLabel node) starts a new basic block. Data flow analysis are done on the graph of basic blocks and most of data flow information is get via basic blocks. The graph of basic blocks can be get from subprogram symbol. Relation between control flow and data flow: Methods listed here are used after flow analysis to get information or to modify control flow. (There may be many methods private to flow analysis modules other than the methods listed below.) When control flow is changed, data flow information may not be consistent because data flow information is not automatically updated by the control flow modification. In order to make them consistent, it is necessary to do data flow analysis again after a group of control flow modifications are completed.
フィールドの概要 | |
static int |
HAS_CALL
|
static int |
HAS_JUMP
|
static int |
HAS_PTR_ASSIGN
|
static int |
HAS_STRUCT_UNION
|
static int |
IS_DELETED
|
static int |
IS_ENTRY
|
static int |
IS_EXIT
|
static int |
IS_MODIFIED
|
static int |
IS_RESTRUCTURED
|
static int |
LOOP_HEAD
|
static int |
LOOP_TAIL
|
static int |
UNDER_VISIT
|
static int |
USE_PTR
|
static int |
VISIT_OVER
|
メソッドの概要 | |
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 |
getAvailOut()
getAvailOut Get bit vector showing AvailOut set of this block. |
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. |
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. |
java.util.List |
getDominatedChildren()
getDominatedChildren setDominatedChildren Get/set the list of basic blocks immediately dominated by this block. |
ExpVector |
getEGen()
getEGen Get bit vector showing EGen set of this block. |
ExpVector |
getEKill()
getEKill Get bit vector showing EKill set of this block. |
ExpVector |
getEKillAll()
getEKillAll Get bit vector showing EKillAll set of this block. |
FlowAnalSymVector |
getExposed()
getExposed Get bit vector showing Exposed set of this block. |
IR |
getFirstSubtree()
getFirstSubtree Get the first subtree contained in this block. |
boolean |
getFlag(int pFlagNumber)
getFlag setFlag getFlag returns the value (true/false) of the flag indicated by pFlagNumber. |
BBlock |
getImmediateDominator()
getImmediateDominator Get/set 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. |
Label |
getLabel()
getLabel Get a label attached to the first top-subtree of this basic block. |
IR |
getLastSubtree()
getLastSubtree Get the last subtree contained in this block. |
FlowAnalSymVector |
getLiveIn()
getLiveIn Get bit vector showing LiveIn set of this block. |
FlowAnalSymVector |
getLiveOut()
getLiveOut Get bit vector showing LiveOut set of this block. |
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. /** setNextInInverseDFO: Set the next BBlock in inverse depth first order from exit BBlock. |
java.util.List |
getPostDominatedChildren()
getPostDominatedChildren setPostDominatedChildren Get/set the list of basic blocks 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. |
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. |
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. |
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 |
isReach(int pPos)
isReach See if definition at position pPos reaches to the entry point of this block. |
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 |
setAflowBBlock(BBlock pBBlock)
|
void |
setDominatedChildren(java.util.LinkedList pDominatedChildren)
|
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 |
setNextInDFO(BBlock pNext)
setNextInDFO Record the next BBlock in depth first order. |
void |
setNextInInverseDFO(BBlock pNext)
|
void |
setPostDominatedChildren(java.util.LinkedList pPostDominatedChildren)
|
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 |
toStringDetail()
toStringDetail |
java.lang.String |
toStringShort()
toStringShort |
フィールドの詳細 |
public static final int IS_RESTRUCTURED
public static final int IS_MODIFIED
public static final int IS_DELETED
public static final int UNDER_VISIT
public static final int VISIT_OVER
public static final int IS_ENTRY
public static final int IS_EXIT
public static final int LOOP_HEAD
public static final int LOOP_TAIL
public static final int HAS_CALL
public static final int HAS_PTR_ASSIGN
public static final int USE_PTR
public static final int HAS_STRUCT_UNION
public static final int HAS_JUMP
メソッドの詳細 |
public int getBlockNumber()
public IR getIrLink()
public void setIrLink(LabeledStmt pLabeledStmt)
public Label getLabel()
public java.util.List getPredList()
public java.util.List getSuccList()
public Edge getPredEdge(BBlock pFromBBlock)
public Edge getSuccEdge(BBlock pToBBlock)
public boolean isEntryBlock()
public boolean isExitBlock()
public HIR controlTransfer()
public BBlock getImmediateDominator()
public void setImmediateDominator(BBlock pDominator)
public java.util.List getDominatedChildren()
public void setDominatedChildren(java.util.LinkedList pDominatedChildren)
public BBlock getImmediatePostDominator()
public void setImmediatePostDominator(BBlock pPostDominator)
public java.util.List getPostDominatedChildren()
public void setPostDominatedChildren(java.util.LinkedList pPostDominatedChildren)
public void linkInDepthFirstOrder(Subp pSubp)
public void linkInInverseDepthFirstOrder(Subp pSubp)
public BBlock getNextInDFO()
public void setNextInDFO(BBlock pNext)
pNext
- Next BBlock in depth first order.
This method is called in linkInDepthFirstOrder.public BBlock getNextInInverseDFO()
public void setNextInInverseDFO(BBlock pNext)
public java.lang.Object getWork()
public void setWork(java.lang.Object pWork)
public java.lang.Object getWorkFA()
public void setWorkFA(java.lang.Object pWorkFA)
public BBlockSubtreeIterator bblockSubtreeIterator()
public BBlockNodeIterator bblockNodeIterator()
public IR getFirstSubtree()
public IR getLastSubtree()
public java.lang.String toStringShort()
public java.lang.String toStringDetail()
public void addToPredList(BBlock pPred)
pPred
- basic block to be added to the predecessor list
of this basic block.public void addToSuccList(BBlock pSucc)
public void deleteFromPredList(BBlock pPred)
pPred
- basic block to be deleted from the predecessor list
of this basic block.public void deleteFromSuccList(BBlock pSucc)
public boolean getFlag(int pFlagNumber)
pFlagNumber
- flag identification number (see below).public void setFlag(int pFlagNumber, boolean pYesNo)
public void allocateSpaceForDataFlowAnalysis(int pPointCount, int pDefCount, int pExpCount)
public boolean isDef(int pPos)
pPos
- position number attached to the definition node.
public boolean isKill(int pPos)
pPos
- position number attached to the definition node.
public boolean isReach(int pPos)
pPos
- position number attached to the definition node.
public boolean isDefined(Sym pSym)
pSym
- symbol representing a variable or a register
or expression identifier.
public boolean isUsed(Sym pSym)
pSym
- symbol representing a variable or a register
or expression identifier.
public boolean isExposed(Sym pSym)
pSym
- symbol representing a variable or a register
or expression identifier.
public boolean isEGen(ExpId pExpId)
pExpId
- expression identifier assigned to the
expression.
public boolean isEKill(ExpId pExpId)
pExpId
- expression identifier assigned to the
expression.
public boolean isAvailIn(ExpId pExpId)
pExpId
- expression identifier
representing an expression. ()
public boolean isAvailOut(ExpId pExpId)
pExpId
- expression identifier
representing an expression. ()
public boolean isLiveIn(Sym pSym)
pSym
- variable or register or expression identifier
representing an expression.
public boolean isLiveOut(Sym pSym)
pSym
- variable or register or expression identifier
representing an expression.
public boolean isDefIn(Sym pSym)
pSym
- variable or register or expression identifier
representing an expression.
public boolean isDefOut(Sym pSym)
pSym
- variable or register or expression identifier
representing an expression.
public DefVector getDef()
public DefVector getKill()
public DefVector getReach()
public FlowAnalSymVector getDefined()
public FlowAnalSymVector getUsed()
public FlowAnalSymVector getExposed()
public ExpVector getEGen()
public ExpVector getEKill()
public ExpVector getEKillAll()
public ExpVector getAvailIn()
public ExpVector getAvailOut()
public FlowAnalSymVector getLiveIn()
public FlowAnalSymVector getLiveOut()
public FlowAnalSymVector getDefIn()
public FlowAnalSymVector getDefOut()
public java.util.Set getDefNodes()
public SubpFlow getSubpFlow()
public int getBBlockNumber()
public void setAflowBBlock(BBlock pBBlock)
public BBlock getAflowBBlock()
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |