streamit.frontend.controlflow
Class DataFlow

java.lang.Object
  extended by streamit.frontend.controlflow.DataFlow
Direct Known Subclasses:
StatementCounter

public abstract class DataFlow
extends Object

Abstract base class for data-flow analyses. This provides the basic algorithm, but still leaves some parts to be filled in by derived classes.

Version:
$Id: DataFlow.java,v 1.3 2006/09/25 13:54:53 dimock Exp $
Author:
David Maze <dmaze@cag.lcs.mit.edu>

Constructor Summary
DataFlow()
           
 
Method Summary
abstract  Lattice flowFunction(CFGNode node, Lattice in)
          Modify a lattice value by passing through a CFG node.
abstract  Lattice getInit()
          Get the lattice value that is at the entry node.
 boolean isForward()
          Determine if this is a forward or backward data-flow analysis.
 Map<CFGNode,Lattice> run(CFG cfg)
          Actually perform the data-flow analysis.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataFlow

public DataFlow()
Method Detail

run

public Map<CFGNode,Lattice> run(CFG cfg)
Actually perform the data-flow analysis.

Parameters:
cfg - control-flow graph to perform analysis on
Returns:
map of CFGNode to Lattice element at entry to the node

getInit

public abstract Lattice getInit()
Get the lattice value that is at the entry node. What value this is depends on the particular analysis being performed.

Returns:
lattice value at the entry node of the CFG

flowFunction

public abstract Lattice flowFunction(CFGNode node,
                                     Lattice in)
Modify a lattice value by passing through a CFG node.

Parameters:
node - CFG node to consider
in - lattice value at entry to the node
Returns:
lattice value at exit from the node

isForward

public boolean isForward()
Determine if this is a forward or backward data-flow analysis.

Returns:
true if this is a forward analysis