public interface DataflowAnalysis<Fact>
Dataflow
class.
In order to avoid duplicating functionality (such as caching of start and
result facts), most analyses should extend the
BasicAbstractDataflowAnalysis
or AbstractDataflowAnalysis
classes rather than directly implementing this interface.
Dataflow
Modifier and Type | Method and Description |
---|---|
void |
copy(Fact source,
Fact dest)
Copy dataflow facts.
|
Fact |
createFact()
Create empty (uninitialized) dataflow facts for one program point.
|
void |
edgeTransfer(Edge edge,
Fact fact)
Edge transfer function.
|
java.lang.String |
factToString(Fact fact)
Return a String representation of given Fact.
|
void |
finishIteration()
Called after finishing an iteration of analysis.
|
BlockOrder |
getBlockOrder(CFG cfg)
Return the BlockOrder specifying the order in which BasicBlocks should be
visited in the main dataflow loop.
|
Fact |
getFactAfterLocation(Location location)
Get the dataflow fact representing the point just after given Location.
|
Fact |
getFactAtLocation(Location location)
Get dataflow fact at (just before) given Location.
|
Fact |
getFactOnEdge(Edge edge)
Get the fact that is true on the given control edge.
|
int |
getLastUpdateTimestamp(Fact fact) |
Fact |
getResultFact(BasicBlock block)
Get the result fact for given basic block.
|
Fact |
getStartFact(BasicBlock block)
Get the start fact for given basic block.
|
void |
initEntryFact(Fact result)
Initialize the "entry" fact for the graph.
|
boolean |
isForwards()
Returns true if the analysis is forwards, false if backwards.
|
boolean |
isTop(Fact fact)
Is the given fact the top value.
|
void |
makeFactTop(Fact fact)
Make given fact the top value.
|
void |
meetInto(Fact fact,
Edge edge,
Fact result)
Meet a dataflow fact associated with an incoming edge into another fact.
|
boolean |
same(Fact fact1,
Fact fact2)
Are given dataflow facts the same?
|
void |
setLastUpdateTimestamp(Fact fact,
int timestamp) |
void |
startIteration()
Called before beginning an iteration of analysis.
|
void |
transfer(BasicBlock basicBlock,
org.apache.bcel.generic.InstructionHandle end,
Fact start,
Fact result)
Transfer function for the analysis.
|
Fact createFact()
Fact getStartFact(BasicBlock block)
block
- the basic blockFact getResultFact(BasicBlock block)
block
- the basic blockFact getFactAtLocation(Location location) throws DataflowAnalysisException
location
- the LocationDataflowAnalysisException
Fact getFactAfterLocation(Location location) throws DataflowAnalysisException
location
- the LocationDataflowAnalysisException
Fact getFactOnEdge(Edge edge) throws DataflowAnalysisException
edge
- the edgeDataflowAnalysisException
void initEntryFact(Fact result) throws DataflowAnalysisException
DataflowAnalysisException
void makeFactTop(Fact fact)
boolean isTop(Fact fact)
boolean isForwards()
BlockOrder getBlockOrder(CFG cfg)
cfg
- the CFG upon which we're performing dataflow analysisvoid transfer(BasicBlock basicBlock, @CheckForNull org.apache.bcel.generic.InstructionHandle end, Fact start, Fact result) throws DataflowAnalysisException
basicBlock
- the basic blockend
- if nonnull, stop before considering this instruction;
otherwise, consider all of the instructions in the basic blockstart
- dataflow facts at beginning of block (if forward analysis) or
end of block (if backwards analysis)result
- resulting dataflow facts at other end of blockDataflowAnalysisException
void edgeTransfer(Edge edge, Fact fact) throws DataflowAnalysisException
A do-nothing implementation is legal, and appropriate for analyses where branches are not significant.
edge
- the Edgefact
- a dataflow factDataflowAnalysisException
void meetInto(Fact fact, Edge edge, Fact result) throws DataflowAnalysisException
fact
- the predecessor fact (incoming edge)edge
- the edge from the predecessorresult
- the result factDataflowAnalysisException
void startIteration()
void finishIteration()
int getLastUpdateTimestamp(Fact fact)
void setLastUpdateTimestamp(Fact fact, int timestamp)
java.lang.String factToString(Fact fact)
fact
- a dataflow factFindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.