coins.aflow
Class SubpFlowImpl

java.lang.Object
  extended bycoins.aflow.SubpFlowImpl
All Implemented Interfaces:
SubpFlow
Direct Known Subclasses:
HirSubpFlowImpl

public abstract class SubpFlowImpl
extends java.lang.Object
implements SubpFlow

SubpFlowImpl class: Subprogram flow analysis class. Fields and methods are common between HIR and LIR.


Field Summary
protected  BBlock[] fBBlockOfIR
           
protected  FAList fBBlockTable
           
protected  BBlock fCurrentBBlock
           
protected  IrList fDfoList
           
protected  BBlock fEntryBBlock
           
protected  BBlock fExitBBlock
           
protected  FlowExpId[] fExpIdTable
           
 boolean fHirAnalExtended
           
protected  IrList fInverseDfoList
           
protected  int fIrIndexMax
           
protected  int fIrIndexMin
           
 Flow flow
           
 FlowRoot flowRoot
           
protected  BBlock fPrevBBlockInSearch
           
protected  java.util.List fReachableBBlocks
           
protected  RecordAlias fRecordAlias
           
 RecordSetRefReprs fRecordSetRefReprs
           
protected  boolean fRestructured
           
 FlowResults fResults
           
protected  java.util.Set fSetOfAddressTakenVariables
           
protected  java.util.Set fSetOfGlobalVariables
           
protected  SetRefRepr[] fSetRefReprTable
           
protected  SubpDefinition fSubpDefinition
           
protected  java.util.Map fTempExpCorrespondence
           
 HirRoot hirRoot
           
 IoRoot ioRoot
           
 SymRoot symRoot
           
 
Constructor Summary
SubpFlowImpl(SubpDefinition pSubpDef, FlowResults pResults)
           
 
Method Summary
 void allocateBBlockOfIR()
           
 void allocateExpIdTable()
           
 void allocateSetRefReprTable()
           
 AssignFlowExpId assigner()
          Retuns the AssignFlowExpId object this SubpFlow is associated with.
 BBlock bblock(LabeledStmt pLabeledStmt)
          Create new basic block corresponding to the HIR labeled statement pLabeledStmt.
 BBlockVector bblockVector()
          Create new basic block corresponding to the LIR Prologue node pPrologue.
 java.util.Iterator cfgBfoIterator()
           
 java.util.Iterator cfgFromExitIterator()
          cfgFromExitIterator: Traverse basic blocks in CFG (control flow graph) in inverse depth first order from the exit BBlock.
 java.util.Iterator cfgIterator()
          cfgIterator: Traverse basic blocks in CFG (control flow graph) in depth first order.
 void clear()
          Clear flow analysis information by resetting fIrIndexMin = 0, fIrIndexMax = 0, fSetOfGlobalSymbols, fSetOfAddressTakenSymbols.
 java.util.Set computeSetOfAddressTakenVariables()
          computeSetOfAddressTakenVariables: Compute the set of variables whose address is taken (e.g.
 void computeSetOfAddressTakenVariables(HIR pHir, java.util.Set pSet, boolean pAddrOperand)
          computeSetOfAddressTakenVariables: Compute the set of variables whose address is taken (e.g.
 java.util.Set computeSetOfGlobalVariables()
          computeSetOfGlobalVariables: Compute the set of global variables and record it in fSetOfGlobalVariables.
 void correlateBBlockAndIR()
          correlateBBlockAndIR: Correlate BBlock and IR so that getBBlockOfIR(hir.getIndex()) become effective.
 DefVector defVector()
           
 DefVectorIterator defVectorIterator(DefVector pDefVector)
           
 ExpVector expVector()
           
 ExpVectorIterator expVectorIterator(ExpVector pExpVector)
           
 void findDAvailInAvailOut()
          Finds the "DAvailIn" and "DAvailOut" vectors for all BBlocks contained in this SubpFlow.
 void findDDefInDefOut()
          Finds the "DDefIn" and "DDefOut" vectors for all BBlocks contained in this SubpFlow.
 void findDDefined()
          Finds the "DDefined" vectors for all BBlocks contained in this SubpFlow.
 void findDDefUse()
           
 void findDefUse()
          Finds the DefUseLists for all the FlowAnalSyms that appear in this SubpFlow.
 void findDEGen()
          Finds the "DEGen" vectors for all BBlocks contained in this SubpFlow.
 void findDExposedUsed()
          Finds the "DExpesed" and "PExposed" vectors for all BBlocks contained in this SubpFlow.
 void findDKill()
          Finds the "DKill" vectors for all BBlocks contained in this SubpFlow.
 void findDReach()
          Finds the "DReach" vectors for all BBlocks contained in this SubpFlow.
 void findDUseDef()
           
 void findPDef()
          Finds the "PDef" vectors for all BBlocks contained in this SubpFlow.
 void findPDefined()
          Finds the "PDefined" vectors for all BBlocks contained in this SubpFlow.
 void findPEKill()
          Finds the "PEKill" vectors for all BBlocks contained in this SubpFlow.
 void findPExposedUsed()
          Finds the "PExposed" and "PUsed" vectors for all BBlocks contained in this SubpFlow.
 void findPKill()
          Finds the "PKill" vectors for all BBlocks contained in this SubpFlow.
 void findPLiveInLiveOut()
          Finds the "PLiveIn" and "PLiveOut" vectors for all BBlocks contained in this SubpFlow.
 void findPReach()
          Finds the "PReach" vectors for all BBlocks contained in this SubpFlow.
 void findUseDef()
          Finds the UDLists for all the FlowAnalSyms that appear in this SubpFlow.
 FlowAnalSymVector flowAnalSymVector()
           
 BBlock getBBlock(int pBlockNumber)
          getBBlock: Get the basic block whose block number is pBlockNumber.
 BBlock getBBlockOfIR(int pIndex)
          Get BBlock corresponding to the IR node indexed by pIndex.
 java.util.List getBBlocks()
          Same as { #getReachableBBlocks()}.
 java.util.List getBBlocksFromEntry()
          Returns the list of BBlocks in the breadth first order beginning from the entry bblock.
 java.util.List getBBlocksFromExit()
          Returns the list of BBlocks in the breadth first order beginning from the exit bblock and traversing backward.
 FAList getBBlockTable()
          List of BBlock object that this SubpFlow has ever recorded.
 DefUseList getDefUseList(FlowAnalSym pFlowAnalSym)
          Returns the DefUseList for the given FlowAnalSym in this SubpFlow.
 BBlock getEntryBBlock()
           
 BBlock getExitBBlock()
           
 FlowExpId getExpId(IR pIr)
           
 FlowExpId getExpId(IR pIr, int pIndex)
           
 Exp getExpOfTemp(Var pTempVar)
          Get the expression represented by the temporal variable pTempVar.
 FAList getFlowExpIdTable()
          Returns the FlowExpId table (index number and its associated FlowExpId) for this SubpFlow.
 int getIrIndexMax()
           
 int getIrIndexMin()
           
 int getNumberOfBBlocks()
           
 int getNumberOfRelevantBBlocks()
          Number of reachable BBlocks.
 java.util.List getReachableBBlocks()
          Returns a list of BBlocks that are reachable from the entry BBlock.
 RecordAlias getRecordAlias()
          If returned value is not null, then alias is considered in data flow analysis.
 boolean getRestructureFlag()
           
 SetRefRepr getSetRefReprOfIR(int pIndex)
          Get SetRefRepr corresponding to the IR node indexed by pIndex.
 FAList getSetRefReprs()
          Returns the list of SetRefRepr objects within this SubpFlow.
 SubpDefinition getSubpDefinition()
           
 Subp getSubpSym()
           
 FAList getSymIndexTable()
          Returns the table of symbols possibly accessed in this SubpFlow.
 UDList getUDList(FlowAnalSym pFlowAnalSym)
          Returns the UDList for the given FlowAnalSym in this SubpFlow.
 void initiateDataFlow()
          Initiate data flow analysis.
 void makeDominatorTree()
          Makes the dominator tree.
 void makePostdominatorTree()
          Makes the postdominator tree.
 PointVector pointVector()
           
 PointVectorIterator pointVectorIterator(PointVector pPointVector)
           
 void printExpIdTable()
           
 void recordBBlock(BBlock pBlock)
           
 FlowResults results()
           
 void setBBlockOfIR(BBlock pBBlock, int pIndex)
          Set BBlock corresponding to the IR node indexed by pIndex.
 void setBBlocks(java.util.List pBBlocks)
          Same as { #setReachableBBlocks()}.
 void setDefUseList(FlowAnalSym pFlowAnalSym, DefUseList pDefUseList)
          Sets the DefUseList for the given FlowAnalSym in this SubpFlow.
 void setEntryBBlock(BBlock pBlock)
           
 void setExitBBlock(BBlock pBBlock)
           
 void setExpId(IR pIr, FlowExpId pFlowExpId)
           
 void setExpOfTemp(Var pTempVar, Exp pExp)
          Record pExp as the expression represented by the temporal variable pTempVar.
 void setFlowExpIdTable(FAList pFlowExpIdTable)
          Sets the FlowExpId table (index number and its associated FlowExpId) for this SubpFlow.
 java.util.Set setOfAddressTakenVariables()
           
 java.util.Set setOfGlobalVariables()
           
 void setReachableBBlocks(java.util.List pBBlocks)
          Sets a list of BBlocks that are reachable from the entry BBlock.
 void setRecordAlias(RecordAlias pRecordAlias)
          Record a RecordAlias instance in order to indicate that alias is considered in data flow analysis.
 void setRestructureFlag()
           
 void setSetRefReprOfIR(SetRefRepr pSetRefRepr, int pIndex)
          Set SetRefRepr corresponding to the IR node indexed by pIndex.
 void setSetRefReprs(FAList pSetReprs)
          Sets the list of SetRefRepr objects within this SubpFlow.
 void setSymIndexTable(FAList pSymIndexTable)
          Sets the table of symbols possibly accessed in this SubpFlow.
 void setUDList(FlowAnalSym pFlowAnalSym, UDList pUDList)
          Sets the UDList for the given FlowAnalSym in this SubpFlow.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface coins.aflow.SubpFlow
bblockSubtreeIterator, controlFlowAnal
 

Field Detail

flowRoot

public final FlowRoot flowRoot

ioRoot

public final IoRoot ioRoot

symRoot

public final SymRoot symRoot

hirRoot

public final HirRoot hirRoot

flow

public final Flow flow

fSubpDefinition

protected SubpDefinition fSubpDefinition

fPrevBBlockInSearch

protected BBlock fPrevBBlockInSearch

fEntryBBlock

protected BBlock fEntryBBlock

fExitBBlock

protected BBlock fExitBBlock

fCurrentBBlock

protected BBlock fCurrentBBlock

fBBlockTable

protected FAList fBBlockTable

fDfoList

protected IrList fDfoList

fInverseDfoList

protected IrList fInverseDfoList

fReachableBBlocks

protected java.util.List fReachableBBlocks

fResults

public final FlowResults fResults

fHirAnalExtended

public boolean fHirAnalExtended

fRecordSetRefReprs

public RecordSetRefReprs fRecordSetRefReprs

fSetRefReprTable

protected SetRefRepr[] fSetRefReprTable

fBBlockOfIR

protected BBlock[] fBBlockOfIR

fIrIndexMin

protected int fIrIndexMin

fIrIndexMax

protected int fIrIndexMax

fExpIdTable

protected FlowExpId[] fExpIdTable

fRestructured

protected boolean fRestructured

fSetOfGlobalVariables

protected java.util.Set fSetOfGlobalVariables

fSetOfAddressTakenVariables

protected java.util.Set fSetOfAddressTakenVariables

fTempExpCorrespondence

protected java.util.Map fTempExpCorrespondence

fRecordAlias

protected RecordAlias fRecordAlias
Constructor Detail

SubpFlowImpl

public SubpFlowImpl(SubpDefinition pSubpDef,
                    FlowResults pResults)
Method Detail

getEntryBBlock

public BBlock getEntryBBlock()
Specified by:
getEntryBBlock in interface SubpFlow

setEntryBBlock

public void setEntryBBlock(BBlock pBlock)
Specified by:
setEntryBBlock in interface SubpFlow

getExitBBlock

public BBlock getExitBBlock()
Specified by:
getExitBBlock in interface SubpFlow

setExitBBlock

public void setExitBBlock(BBlock pBBlock)
Specified by:
setExitBBlock in interface SubpFlow

bblock

public BBlock bblock(LabeledStmt pLabeledStmt)
Description copied from interface: SubpFlow
Create new basic block corresponding to the HIR labeled statement pLabeledStmt.

Specified by:
bblock in interface SubpFlow

bblockVector

public BBlockVector bblockVector()
Description copied from interface: SubpFlow
Create new basic block corresponding to the LIR Prologue node pPrologue.

Specified by:
bblockVector in interface SubpFlow

expVector

public ExpVector expVector()
Specified by:
expVector in interface SubpFlow

pointVector

public PointVector pointVector()
Specified by:
pointVector in interface SubpFlow

defVector

public DefVector defVector()
Specified by:
defVector in interface SubpFlow

flowAnalSymVector

public FlowAnalSymVector flowAnalSymVector()
Specified by:
flowAnalSymVector in interface SubpFlow

pointVectorIterator

public PointVectorIterator pointVectorIterator(PointVector pPointVector)

defVectorIterator

public DefVectorIterator defVectorIterator(DefVector pDefVector)

expVectorIterator

public ExpVectorIterator expVectorIterator(ExpVector pExpVector)

getBBlock

public BBlock getBBlock(int pBlockNumber)
Description copied from interface: SubpFlow
getBBlock: Get the basic block whose block number is pBlockNumber.

Specified by:
getBBlock in interface SubpFlow
Returns:
basic block that has pBlockNumber as its block number. If the BBlock having pBlocknumber is deleted (has IS_DELETED flag) then return null.

recordBBlock

public void recordBBlock(BBlock pBlock)
Specified by:
recordBBlock in interface SubpFlow

getNumberOfBBlocks

public int getNumberOfBBlocks()
Specified by:
getNumberOfBBlocks in interface SubpFlow

getSubpDefinition

public SubpDefinition getSubpDefinition()
Specified by:
getSubpDefinition in interface SubpFlow

getSubpSym

public Subp getSubpSym()
Specified by:
getSubpSym in interface SubpFlow

cfgIterator

public java.util.Iterator cfgIterator()
cfgIterator: Traverse basic blocks in CFG (control flow graph) in depth first order. Available methods: next(), hasNext().

Specified by:
cfgIterator in interface SubpFlow

cfgFromExitIterator

public java.util.Iterator cfgFromExitIterator()
Description copied from interface: SubpFlow
cfgFromExitIterator: Traverse basic blocks in CFG (control flow graph) in inverse depth first order from the exit BBlock. Available methods: next(), hasNext().

Specified by:
cfgFromExitIterator in interface SubpFlow

getBBlockTable

public FAList getBBlockTable()
Description copied from interface: SubpFlow
List of BBlock object that this SubpFlow has ever recorded. Deleted (unreachable, redundant) BBlocks are included.

Specified by:
getBBlockTable in interface SubpFlow

getBBlocks

public java.util.List getBBlocks()
Description copied from interface: SubpFlow
Same as { #getReachableBBlocks()}.

Specified by:
getBBlocks in interface SubpFlow

setBBlocks

public void setBBlocks(java.util.List pBBlocks)
Description copied from interface: SubpFlow
Same as { #setReachableBBlocks()}.

Specified by:
setBBlocks in interface SubpFlow

getReachableBBlocks

public java.util.List getReachableBBlocks()
Description copied from interface: SubpFlow
Returns a list of BBlocks that are reachable from the entry BBlock. Usually this is the set of BBlocks to consider.

Specified by:
getReachableBBlocks in interface SubpFlow

setReachableBBlocks

public void setReachableBBlocks(java.util.List pBBlocks)
Description copied from interface: SubpFlow
Sets a list of BBlocks that are reachable from the entry BBlock. Usually this is the set of BBlocks to consider.

Specified by:
setReachableBBlocks in interface SubpFlow

getBBlocksFromEntry

public java.util.List getBBlocksFromEntry()
Description copied from interface: SubpFlow
Returns the list of BBlocks in the breadth first order beginning from the entry bblock.

Specified by:
getBBlocksFromEntry in interface SubpFlow

getBBlocksFromExit

public java.util.List getBBlocksFromExit()
Description copied from interface: SubpFlow
Returns the list of BBlocks in the breadth first order beginning from the exit bblock and traversing backward.

Specified by:
getBBlocksFromExit in interface SubpFlow

getNumberOfRelevantBBlocks

public int getNumberOfRelevantBBlocks()
Description copied from interface: SubpFlow
Number of reachable BBlocks.

Specified by:
getNumberOfRelevantBBlocks in interface SubpFlow

getFlowExpIdTable

public FAList getFlowExpIdTable()
Description copied from interface: SubpFlow
Returns the FlowExpId table (index number and its associated FlowExpId) for this SubpFlow.

Specified by:
getFlowExpIdTable in interface SubpFlow

setFlowExpIdTable

public void setFlowExpIdTable(FAList pFlowExpIdTable)
Description copied from interface: SubpFlow
Sets the FlowExpId table (index number and its associated FlowExpId) for this SubpFlow.

Specified by:
setFlowExpIdTable in interface SubpFlow

results

public FlowResults results()
Specified by:
results in interface SubpFlow

assigner

public AssignFlowExpId assigner()
Description copied from interface: SubpFlow
Retuns the AssignFlowExpId object this SubpFlow is associated with. The AssignFlowExpId object knows which FlowExpId to issue next.

Specified by:
assigner in interface SubpFlow

getSetRefReprs

public FAList getSetRefReprs()
Description copied from interface: SubpFlow
Returns the list of SetRefRepr objects within this SubpFlow.

Specified by:
getSetRefReprs in interface SubpFlow

setSetRefReprs

public void setSetRefReprs(FAList pSetReprs)
Description copied from interface: SubpFlow
Sets the list of SetRefRepr objects within this SubpFlow.

Specified by:
setSetRefReprs in interface SubpFlow

cfgBfoIterator

public java.util.Iterator cfgBfoIterator()
Specified by:
cfgBfoIterator in interface SubpFlow

getDefUseList

public DefUseList getDefUseList(FlowAnalSym pFlowAnalSym)
Description copied from interface: SubpFlow
Returns the DefUseList for the given FlowAnalSym in this SubpFlow.

Specified by:
getDefUseList in interface SubpFlow

setDefUseList

public void setDefUseList(FlowAnalSym pFlowAnalSym,
                          DefUseList pDefUseList)
Description copied from interface: SubpFlow
Sets the DefUseList for the given FlowAnalSym in this SubpFlow.

Specified by:
setDefUseList in interface SubpFlow

getUDList

public UDList getUDList(FlowAnalSym pFlowAnalSym)
Description copied from interface: SubpFlow
Returns the UDList for the given FlowAnalSym in this SubpFlow.

Specified by:
getUDList in interface SubpFlow

setUDList

public void setUDList(FlowAnalSym pFlowAnalSym,
                      UDList pUDList)
Description copied from interface: SubpFlow
Sets the UDList for the given FlowAnalSym in this SubpFlow.

Specified by:
setUDList in interface SubpFlow

getSymIndexTable

public FAList getSymIndexTable()
Description copied from interface: SubpFlow
Returns the table of symbols possibly accessed in this SubpFlow. Globol symbols are always included.

Specified by:
getSymIndexTable in interface SubpFlow

setSymIndexTable

public void setSymIndexTable(FAList pSymIndexTable)
Description copied from interface: SubpFlow
Sets the table of symbols possibly accessed in this SubpFlow.

Specified by:
setSymIndexTable in interface SubpFlow

makeDominatorTree

public void makeDominatorTree()
Description copied from interface: SubpFlow
Makes the dominator tree.

Specified by:
makeDominatorTree in interface SubpFlow

makePostdominatorTree

public void makePostdominatorTree()
Description copied from interface: SubpFlow
Makes the postdominator tree.

Specified by:
makePostdominatorTree in interface SubpFlow

initiateDataFlow

public void initiateDataFlow()
Description copied from interface: SubpFlow
Initiate data flow analysis. See subinterfaces for what is actually done.

Specified by:
initiateDataFlow in interface SubpFlow

findPDef

public void findPDef()
Description copied from interface: SubpFlow
Finds the "PDef" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPDef in interface SubpFlow

findDDefined

public void findDDefined()
Description copied from interface: SubpFlow
Finds the "DDefined" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDDefined in interface SubpFlow

findPDefined

public void findPDefined()
Description copied from interface: SubpFlow
Finds the "PDefined" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPDefined in interface SubpFlow

findDKill

public void findDKill()
Description copied from interface: SubpFlow
Finds the "DKill" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDKill in interface SubpFlow

findPKill

public void findPKill()
Description copied from interface: SubpFlow
Finds the "PKill" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPKill in interface SubpFlow

findDExposedUsed

public void findDExposedUsed()
Description copied from interface: SubpFlow
Finds the "DExpesed" and "PExposed" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDExposedUsed in interface SubpFlow

findPExposedUsed

public void findPExposedUsed()
Description copied from interface: SubpFlow
Finds the "PExposed" and "PUsed" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPExposedUsed in interface SubpFlow

findDEGen

public void findDEGen()
Description copied from interface: SubpFlow
Finds the "DEGen" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDEGen in interface SubpFlow

findPEKill

public void findPEKill()
Description copied from interface: SubpFlow
Finds the "PEKill" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPEKill in interface SubpFlow

findDReach

public void findDReach()
Description copied from interface: SubpFlow
Finds the "DReach" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDReach in interface SubpFlow

findPReach

public void findPReach()
Description copied from interface: SubpFlow
Finds the "PReach" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPReach in interface SubpFlow

findDAvailInAvailOut

public void findDAvailInAvailOut()
Description copied from interface: SubpFlow
Finds the "DAvailIn" and "DAvailOut" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDAvailInAvailOut in interface SubpFlow

findPLiveInLiveOut

public void findPLiveInLiveOut()
Description copied from interface: SubpFlow
Finds the "PLiveIn" and "PLiveOut" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findPLiveInLiveOut in interface SubpFlow

findDDefInDefOut

public void findDDefInDefOut()
Description copied from interface: SubpFlow
Finds the "DDefIn" and "DDefOut" vectors for all BBlocks contained in this SubpFlow. The control flow graph must already be created.

Specified by:
findDDefInDefOut in interface SubpFlow

findDDefUse

public void findDDefUse()

findDUseDef

public void findDUseDef()

findDefUse

public void findDefUse()
Description copied from interface: SubpFlow
Finds the DefUseLists for all the FlowAnalSyms that appear in this SubpFlow. The control flow graph must already be created.

Specified by:
findDefUse in interface SubpFlow

findUseDef

public void findUseDef()
Description copied from interface: SubpFlow
Finds the UDLists for all the FlowAnalSyms that appear in this SubpFlow. The control flow graph must already be created.

Specified by:
findUseDef in interface SubpFlow

allocateSetRefReprTable

public void allocateSetRefReprTable()

getSetRefReprOfIR

public SetRefRepr getSetRefReprOfIR(int pIndex)
Description copied from interface: SubpFlow
Get SetRefRepr corresponding to the IR node indexed by pIndex. It is cleared by clear() of FlowResults.

Specified by:
getSetRefReprOfIR in interface SubpFlow
Returns:
SetRefRepr corresponding to the node; return null if no corresponding one.

setSetRefReprOfIR

public void setSetRefReprOfIR(SetRefRepr pSetRefRepr,
                              int pIndex)
Description copied from interface: SubpFlow
Set SetRefRepr corresponding to the IR node indexed by pIndex. It is cleared by clear() of FlowResults.

Specified by:
setSetRefReprOfIR in interface SubpFlow

correlateBBlockAndIR

public void correlateBBlockAndIR()
Description copied from interface: SubpFlow
correlateBBlockAndIR: Correlate BBlock and IR so that getBBlockOfIR(hir.getIndex()) become effective. Before calling this, controlFlowAnal() should be called. This may be skipped if setBBlockOfIR is called for each IR in some other processing for the subprogram corresponding to this SubpFlow.

Specified by:
correlateBBlockAndIR in interface SubpFlow

allocateBBlockOfIR

public void allocateBBlockOfIR()

getBBlockOfIR

public BBlock getBBlockOfIR(int pIndex)
Description copied from interface: SubpFlow
Get BBlock corresponding to the IR node indexed by pIndex. It is cleared by clear() of FlowResults.

Specified by:
getBBlockOfIR in interface SubpFlow
Returns:
BBlock corresponding to the node; return null if no corresponding one.

setBBlockOfIR

public void setBBlockOfIR(BBlock pBBlock,
                          int pIndex)
Description copied from interface: SubpFlow
Set BBlock corresponding to the IR node indexed by pIndex. It is cleared by clear() of FlowResults.

Specified by:
setBBlockOfIR in interface SubpFlow

getIrIndexMin

public int getIrIndexMin()
Specified by:
getIrIndexMin in interface SubpFlow

getIrIndexMax

public int getIrIndexMax()
Specified by:
getIrIndexMax in interface SubpFlow

allocateExpIdTable

public void allocateExpIdTable()
Specified by:
allocateExpIdTable in interface SubpFlow

getExpId

public FlowExpId getExpId(IR pIr)
Specified by:
getExpId in interface SubpFlow

getExpId

public FlowExpId getExpId(IR pIr,
                          int pIndex)

setExpId

public void setExpId(IR pIr,
                     FlowExpId pFlowExpId)
Specified by:
setExpId in interface SubpFlow

printExpIdTable

public void printExpIdTable()
Specified by:
printExpIdTable in interface SubpFlow

setOfGlobalVariables

public java.util.Set setOfGlobalVariables()
Specified by:
setOfGlobalVariables in interface SubpFlow

setOfAddressTakenVariables

public java.util.Set setOfAddressTakenVariables()
Specified by:
setOfAddressTakenVariables in interface SubpFlow

clear

public void clear()
Description copied from interface: SubpFlow
Clear flow analysis information by resetting fIrIndexMin = 0, fIrIndexMax = 0, fSetOfGlobalSymbols, fSetOfAddressTakenSymbols.

Specified by:
clear in interface SubpFlow

computeSetOfGlobalVariables

public java.util.Set computeSetOfGlobalVariables()
computeSetOfGlobalVariables: Compute the set of global variables and record it in fSetOfGlobalVariables.

Specified by:
computeSetOfGlobalVariables in interface SubpFlow
Returns:
the set of global variables.

computeSetOfAddressTakenVariables

public java.util.Set computeSetOfAddressTakenVariables()
computeSetOfAddressTakenVariables: Compute the set of variables whose address is taken (e.g. (addr (var )), (addr (subs (var ) ... ) ) for this subprogram definition.

Specified by:
computeSetOfAddressTakenVariables in interface SubpFlow

computeSetOfAddressTakenVariables

public void computeSetOfAddressTakenVariables(HIR pHir,
                                              java.util.Set pSet,
                                              boolean pAddrOperand)
computeSetOfAddressTakenVariables: Compute the set of variables whose address is taken (e.g. (addr (var )), (addr (subs (var ) ... ) ) within the given HIR subtree.


setRestructureFlag

public void setRestructureFlag()
Specified by:
setRestructureFlag in interface SubpFlow

getRestructureFlag

public boolean getRestructureFlag()
Specified by:
getRestructureFlag in interface SubpFlow

setRecordAlias

public void setRecordAlias(RecordAlias pRecordAlias)
Description copied from interface: SubpFlow
Record a RecordAlias instance in order to indicate that alias is considered in data flow analysis. If pRecordAlias is not null, alias is considered. If pRecordAlias is null, alias is not considered.

Specified by:
setRecordAlias in interface SubpFlow
Parameters:
pRecordAlias - is an instance of RecordAlias keeping the the result of alias analysis for this subprogram.

getRecordAlias

public RecordAlias getRecordAlias()
Description copied from interface: SubpFlow
If returned value is not null, then alias is considered in data flow analysis. If it is null, then alias is not considered. The returned value is used to get alias information for data flow analysis.

Specified by:
getRecordAlias in interface SubpFlow
Returns:
RecordAlias instance set by setRecordAlias method.

setExpOfTemp

public void setExpOfTemp(Var pTempVar,
                         Exp pExp)
Description copied from interface: SubpFlow
Record pExp as the expression represented by the temporal variable pTempVar.

Specified by:
setExpOfTemp in interface SubpFlow
Parameters:
pTempVar - variable introduced to represent an expression (in process of optimization, etc.).
pExp -

getExpOfTemp

public Exp getExpOfTemp(Var pTempVar)
Description copied from interface: SubpFlow
Get the expression represented by the temporal variable pTempVar.

Specified by:
getExpOfTemp in interface SubpFlow
Parameters:
pTempVar - variable introduced to represent an expression (in process of optimization, etc.).
Returns:
the expression represented by the temporal variable.