Class Dataflow<Fact, AnalysisType extends DataflowAnalysis<Fact>>
java.lang.Object
edu.umd.cs.findbugs.ba.Dataflow<Fact, AnalysisType>
- Direct Known Subclasses:
AbstractDataflow, BlockTypeDataflow, CallListDataflow, ConstantDataflow, LiveLocalStoreDataflow, LockDataflow, ObligationDataflow, ReturnPathDataflow, ReturnPathTypeDataflow, TypeDataflow, TypeQualifierDataflow
Perform dataflow analysis on a method using a control flow graph. Both
forward and backward analyses can be performed.
- The "start" point of each block is the entry (forward analyses) or the exit (backward analyses).
- The "result" point of each block is the exit (forward analyses) or the entry (backward analyses).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AnalysisTypeprivate final BlockOrderprivate final CFGstatic booleanprivate final booleanprivate static final intprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringblockId(BasicBlock bb) private static voiddebug(BasicBlock bb, BasicBlock pred, Edge edge, String msg) private static voiddebug(BasicBlock bb, String msg) voiddumpDataflow(AnalysisType analysis) voidexecute()Run the algorithm.Get the analysis object.getCFG()Get the CFG object.getFactAfterLocation(Location location) Get the dataflow fact representing the point just after given Location.getFactAtLocation(Location location) Get dataflow fact at (just before) given Location.getFactOnEdge(Edge edge) Get the fact that is true on the given control edge.private StringintReturn the number of iterations of the main execution loop.getResultFact(BasicBlock block) Get dataflow facts for end of given block.getStartFact(BasicBlock block) Get dataflow facts for start of given block.private BasicBlockGet the "logical" entry block of the CFG.Return an Iterator over edges that connect given block to its logical predecessors.private voidreportAnalysis(String msg)
-
Field Details
-
cfg
-
analysis
-
blockOrder
-
isForwards
private final boolean isForwards -
numIterations
private int numIterations -
DEBUG
public static boolean DEBUG -
MAX_ITERS
private static final int MAX_ITERS
-
-
Constructor Details
-
Dataflow
Constructor.- Parameters:
cfg- the control flow graphanalysis- the DataflowAnalysis to be run
-
-
Method Details
-
getFullyQualifiedMethodName
-
execute
Run the algorithm. Afterwards, caller can use the getStartFact() and getResultFact() methods to to get dataflow facts at start and result points of each block.- Throws:
DataflowAnalysisException
-
reportAnalysis
-
blockId
-
debug
-
debug
-
getNumIterations
public int getNumIterations()Return the number of iterations of the main execution loop. -
getStartFact
Get dataflow facts for start of given block. -
getResultFact
Get dataflow facts for end of given block. -
getFactAtLocation
Get dataflow fact at (just before) given Location. Note "before" is meant in the logical sense, so for backward analyses, before means after the location in the control flow sense.- Parameters:
location- the Location- Returns:
- the dataflow value at given Location
- Throws:
DataflowAnalysisException
-
getFactAfterLocation
Get the dataflow fact representing the point just after given Location. Note "after" is meant in the logical sense, so for backward analyses, after means before the location in the control flow sense.- Parameters:
location- the Location- Returns:
- the dataflow value after given Location
- Throws:
DataflowAnalysisException
-
getFactOnEdge
Get the fact that is true on the given control edge.- Parameters:
edge- the edge- Returns:
- the fact that is true on the edge
- Throws:
DataflowAnalysisException
-
getAnalysis
Get the analysis object. -
getCFG
Get the CFG object. -
logicalPredecessorEdgeIterator
Return an Iterator over edges that connect given block to its logical predecessors. For forward analyses, this is the incoming edges. For backward analyses, this is the outgoing edges. -
logicalEntryBlock
Get the "logical" entry block of the CFG. For forward analyses, this is the entry block. For backward analyses, this is the exit block. -
dumpDataflow
-