edu.cmu.cs.crystal.flow.worklist
Class WorklistTemplate<LE,N,OP extends IAbstractLatticeOperations<LE,N>>
java.lang.Object
edu.cmu.cs.crystal.flow.worklist.WorklistTemplate<LE,N,OP>
- Direct Known Subclasses:
- AbstractWorklist
public abstract class WorklistTemplate<LE,N,OP extends IAbstractLatticeOperations<LE,N>>
- extends Object
This class encapsulates a worklist algorithm for computing fixed points
over flow graphs as a Template Method performAnalysis()
.
Subclasses in particular need to provide
- a flow graph,
- a analysis direction,
- lattice operations,
- an initial lattice value, and
- a way of transferring over flow graph nodes.
While branch sensitivity is achieved in specific implementations of the transfer method,
the implementation keeps incoming analysis results from different branches separate.
This allows precise treatment of short-circuiting Java operators and backwards analysis results.
- Author:
- Kevin Bierhoff
WorklistTemplate
public WorklistTemplate()
performAnalysis
public AnalysisResult<LE,N,OP> performAnalysis()
- Carries out the worklist algorithm to discover the results
of the ASTNode argument. This method implements the Template
Method pattern: It calls abstract methods defined in this class
at the appropriate moments.
- See Also:
getAnalysisDirection()
,
getControlFlowGraph()
,
getLatticeOperations()
,
getEntryValue()
,
transferNode(ICFGNode, Object, ILabel)