harpoon.Analysis.DataFlow
Class LiveVars.BBVisitor

java.lang.Object
  extended by harpoon.Analysis.BasicBlockInterfVisitor
      extended by harpoon.Analysis.DataFlow.DataFlowBasicBlockVisitor
          extended by harpoon.Analysis.DataFlow.BackwardDataFlowBasicBlockVisitor
              extended by harpoon.Analysis.DataFlow.LiveVars.BBVisitor
Direct Known Subclasses:
LiveTemps
Enclosing class:
LiveVars

public abstract static class LiveVars.BBVisitor
extends BackwardDataFlowBasicBlockVisitor


Nested Class Summary
protected static class LiveVars.BBVisitor.LiveVarInfo
           
 
Field Summary
protected  BasicBlock.Factory bbFact
           
 
Constructor Summary
  LiveVars.BBVisitor(BasicBlock.Factory bbFact)
          Constructs a new LiveVars for basicblocks.
protected LiveVars.BBVisitor(BasicBlock.Factory bbFact, boolean ignore)
          Special ctor for use by subclasses so that the system won't break when calling abstract methods that require data that subclasses haven't initialized yet.
  LiveVars.BBVisitor(BasicBlock.Factory bbFact, SetFactory tempSetFact)
          Constructor for LiveVars that allows the user to pass in their own SetFactory for constructing sets of whatever variable types that are used in the analysis.
 
Method Summary
 String dump()
           
 String dump(boolean dumpInstrs)
           
protected abstract  Set findUniverse(Set blockSet)
          Constructs a Set of all of the referenced variables in blocks.
 Set getLiveOnEntry(BasicBlock b)
          Returns the Set of variables that are live on entry to b.
 Set getLiveOnExit(BasicBlock b)
          Returns the Set of variables that are live on exit from b.
protected  void initializeBBtoLVI(Set blockSet, SetFactory setFact)
           
protected abstract  LiveVars.BBVisitor.LiveVarInfo makeUseDef(BasicBlock bb, SetFactory sf)
          Initializes the USE/DEF information for bb and stores it in the returned LiveVarInfo.
 boolean merge(BasicBlockInterf child, BasicBlockInterf parent)
          Merge (Confluence) operator.
 void visit(BasicBlock b)
          Visit (Transfer) function.
 
Methods inherited from class harpoon.Analysis.DataFlow.BackwardDataFlowBasicBlockVisitor
addSuccessors
 
Methods inherited from class harpoon.Analysis.DataFlow.DataFlowBasicBlockVisitor
db, visit
 
Methods inherited from class harpoon.Analysis.BasicBlockInterfVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bbFact

protected BasicBlock.Factory bbFact
Constructor Detail

LiveVars.BBVisitor

protected LiveVars.BBVisitor(BasicBlock.Factory bbFact,
                             boolean ignore)
Special ctor for use by subclasses so that the system won't break when calling abstract methods that require data that subclasses haven't initialized yet.


LiveVars.BBVisitor

public LiveVars.BBVisitor(BasicBlock.Factory bbFact)
Constructs a new LiveVars for basicblocks.
requires: All of the statements in bbFact implement UseDefable
effects: constructs a new BasicBlockVisitor and initializes its internal datasets for analysis of the BasicBlocks in bbFact.

Parameters:
bbFact - BasicBlock.Factory containing BasicBlocks to be analyzed.

LiveVars.BBVisitor

public LiveVars.BBVisitor(BasicBlock.Factory bbFact,
                          SetFactory tempSetFact)
Constructor for LiveVars that allows the user to pass in their own SetFactory for constructing sets of whatever variable types that are used in the analysis.
requires:
  1. All Temps in bbFact are members of the universe for tempSetFact.
  2. All of the statements in bbFact implement UseDefable

effects: constructs a new BasicBlockVisitor and initializes its internal datasets for analysis of the BasicBlocks in bbFact.

Method Detail

initializeBBtoLVI

protected void initializeBBtoLVI(Set blockSet,
                                 SetFactory setFact)

findUniverse

protected abstract Set findUniverse(Set blockSet)
Constructs a Set of all of the referenced variables in blocks. For example, in some analyses this universe will be made up of all of the Temps referenced in blocks. However, for flexibility I have allowed users to define their own universe of values (such as Webs).


merge

public boolean merge(BasicBlockInterf child,
                     BasicBlockInterf parent)
Merge (Confluence) operator.
LVout(bb) = Union over (j elem Succ(bb)) of ( LVin(j) )
parent corresponds to 'bb' above, while child corresponds to a member of Succ('bb'). It is the responsibility of the DataFlow Equation Solver to run merge on all of the Succ('bb')
This method isn't meant to be called by application code; instead, look at one of the DataFlow Equation Solvers in the harpoon.Analysis.DataFlow package.
requires: child and parent are contained in this
effects: Updates the internal information associated with to to include information associated with from

Specified by:
merge in class DataFlowBasicBlockVisitor
See Also:
InstrSolver

visit

public void visit(BasicBlock b)
Visit (Transfer) function.
LVin(bb) = ( LVout(bb) - DEF(bb) ) union USE(bb)

Specified by:
visit in class DataFlowBasicBlockVisitor

makeUseDef

protected abstract LiveVars.BBVisitor.LiveVarInfo makeUseDef(BasicBlock bb,
                                                             SetFactory sf)
Initializes the USE/DEF information for bb and stores it in the returned LiveVarInfo. An example implementation would use Temps to make up their LiveVarInfos.


getLiveOnEntry

public Set getLiveOnEntry(BasicBlock b)
Returns the Set of variables that are live on entry to b.
requires: A DataFlow Solver has been run to completion on the graph of BasicBlocks containing b with this as the DataFlowBasicBlockVisitor.


getLiveOnExit

public Set getLiveOnExit(BasicBlock b)
Returns the Set of variables that are live on exit from b.
requires: A DataFlow Equation Solver has been run to completion on the graph of BasicBlocks containing b with this as the DataFlowBasicBlockVisitor.


dump

public String dump()

dump

public String dump(boolean dumpInstrs)