coins.flow
Class DataFlowHirImpl

java.lang.Object
  extended bycoins.flow.DataFlowImpl
      extended bycoins.flow.DataFlowHirImpl
All Implemented Interfaces:
DataFlow

public class DataFlowHirImpl
extends DataFlowImpl

Implementation of the DataFlow interface for HIR. There are some dependencies between the methods in this class. For example, findReach() mustn't be called before both findDef() and findKill() have been called, and findKill() in turn depends on the result of findDefined(). Access restrictions (or the like) that reflect these dependencies are not yet implemented. Please be careful in using. DataFlowImpl.findAll() method calls these methods in the correct order.


Field Summary
 
Fields inherited from class coins.flow.DataFlowImpl
DEF_INVERTED, DEF_ZERO, EXP_INVERTED, EXP_ZERO, fDbgFlow, fDefCount, fDefNodeIndexTable, fFlowAnalSymTable, flow, flowRoot, fRecordAlias, fShowDataFlow, fSubpFlow, fUndefinedUseNodesOfSym, hirRoot, ioRoot, showDataFlowByName, symRoot
 
Constructor Summary
DataFlowHirImpl(FlowRoot pFlowRoot, HirSubpFlow pSubpFlow)
          Constructs a DataFlow instance and prepares for DFA.
 
Method Summary
 void findEGen(BBlock pBBlock)
          Finds and sets the EGen vector for the given BBlock.
 void findEKill(BBlock pBBlock)
          Finds and sets the EGen vector for the given BBlock.
 FlowAnalSym getFlowAnalSym(int ExpIndex)
          getExpId
 java.util.Set getUseFlowAnalSyms(FlowAnalSym pFlowAnalSym)
          Returns the Set of ExpIds that are contained in the given ExpId and are used.
 java.util.Set getUseFlowAnalSymsForHir(HIR pSubtree)
          !!HIR Returns the Set of ExpIds that fall under the given subtree and are used.
 
Methods inherited from class coins.flow.DataFlowImpl
addEGenExpId, allocateSpace, callModSyms, clean, defLookup, defReverseLookup, expLookup, expReverseLookup, findAll, findAllBitVectors, findAvailInAvailOut, findBasic, findDef, findDef, findDefInDefOut, findDefined, findDefined, findDefUse, findDefUseExhaustively, findEGen, findEKill, findExposed, findExposed, findKill, findKill, findLiveInLiveOut, findReach, findUsed, findUsed, findUseDef, findUseDef, findUseDefExhaustively, getBBlockList, getDefCount, getDefIndex, getDefNodeIndex, getFlowAnalSymCount, getNode, getNodeFromDefIndex, getPointCount, getUndefinedUseNodeOfSym, getUseFlowAnalSyms, handleCall, initiateDataFlow, recordExpId, recordSetRefReprs, showAll, showAllBitVectors, showAvailIn, showAvailInAvailOutRelated, showAvailOut, showBasic, showDef, showDefIn, showDefInDefOutRelated, showDefined, showDefOut, showDefUse, showDefVectors, showEGen, showEKill, showExposed, showExpVectors, showKill, showLiveIn, showLiveInLiveOutRelated, showLiveOut, showReach, showReachRelated, showSolved, showSummary, showUseDef, showVector, showVector, solveAll, toExpVector, toSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFlowHirImpl

public DataFlowHirImpl(FlowRoot pFlowRoot,
                       HirSubpFlow pSubpFlow)
Constructs a DataFlow instance and prepares for DFA.

Method Detail

getFlowAnalSym

public FlowAnalSym getFlowAnalSym(int ExpIndex)
getExpId

Specified by:
getFlowAnalSym in interface DataFlow
Overrides:
getFlowAnalSym in class DataFlowImpl

findEGen

public void findEGen(BBlock pBBlock)
Finds and sets the EGen vector for the given BBlock. This also does VectorOr the EKill bit that corresponds to the ExpId killed by the EGen symbol. //##62

Specified by:
findEGen in interface DataFlow
Overrides:
findEGen in class DataFlowImpl
Parameters:
pBBlock - BBlock whose EGen vector to find.

findEKill

public void findEKill(BBlock pBBlock)
Finds and sets the EGen vector for the given BBlock.

Specified by:
findEKill in interface DataFlow
Overrides:
findEKill in class DataFlowImpl
Parameters:
pBBlock - BBlock whose EGen vector to be found.

getUseFlowAnalSymsForHir

public java.util.Set getUseFlowAnalSymsForHir(HIR pSubtree)
!!HIR Returns the Set of ExpIds that fall under the given subtree and are used. The ExpId that is attached to the "Def node" will not be included if the given subtree is a value-setting node (AssignStmt in HIR). The ExpId that corresponds to the given subtree is also included in the Set. Supports HIR only so far.

Specified by:
getUseFlowAnalSymsForHir in interface DataFlow
Overrides:
getUseFlowAnalSymsForHir in class DataFlowImpl
Parameters:
pSubtree - IR node that is the root of the subtree to examine.
Returns:
the Set of ExpIds that fall under the given subtree and are used.

getUseFlowAnalSyms

public java.util.Set getUseFlowAnalSyms(FlowAnalSym pFlowAnalSym)
Returns the Set of ExpIds that are contained in the given ExpId and are used. The ExpId that is attached to the "Def node" will not be included if the given ExpId is attached to a value-setting node (AssignStmt in HIR). The given ExpId is also contained in the returned Set. See #getUseExpIds(IR)

Overrides:
getUseFlowAnalSyms in class DataFlowImpl
Returns:
the Set of ExpIds that are contained and used.