edu.umd.cs.findbugs.ba

Class BasicAbstractDataflowAnalysis<Fact>

public abstract class BasicAbstractDataflowAnalysis<Fact> extends Object implements DataflowAnalysis<Fact>

A useful starting point for defining a dataflow analysis. Handles access and caching of start and result facts for basic blocks.

Subclasses that model instructions within basic blocks should extend AbstractDataflowAnalysis.

Author: David Hovemeyer

Constructor Summary
BasicAbstractDataflowAnalysis()
Constructor.
Method Summary
voidedgeTransfer(Edge edge, Fact fact)
StringfactToString(Fact fact)
Call this to get a dataflow value as a String.
voidfinishIteration()
FactgetFactAfterLocation(Location location)
Get the dataflow fact representing the point just after given Location.
FactgetFactAtLocation(Location location)
Get dataflow fact at (just before) given Location.
FactgetFactOnEdge(Edge edge)
Get the fact that is true at the target of the given control edge.
intgetLastUpdateTimestamp(Fact fact)
FactgetResultFact(BasicBlock block)
FactgetStartFact(BasicBlock block)
Iterator<Fact>resultFactIterator()
Get an iterator over the result facts.
voidsetLastUpdateTimestamp(Fact fact, int lastUpdateTimestamp)
voidstartIteration()

Constructor Detail

BasicAbstractDataflowAnalysis

public BasicAbstractDataflowAnalysis()
Constructor.

Method Detail

edgeTransfer

public void edgeTransfer(Edge edge, Fact fact)

factToString

public String factToString(Fact fact)
Call this to get a dataflow value as a String. By default, we just call toString(). Subclasses may override to get different behavior.

finishIteration

public void finishIteration()

getFactAfterLocation

public Fact getFactAfterLocation(Location location)
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.

The default implementation ignores instructions within basic blocks. Subclasses that model individual instructions must override this method.

Parameters: location the Location

Returns: the dataflow value after given Location

Throws: DataflowAnalysisException

getFactAtLocation

public Fact getFactAtLocation(Location location)
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.

The default implementation ignores instructions within basic blocks. Subclasses that model individual instructions must override this method.

Parameters: location the Location

Returns: the dataflow value at given Location

Throws: DataflowAnalysisException

getFactOnEdge

public Fact getFactOnEdge(Edge edge)
Get the fact that is true at the target of the given control edge.

Parameters: edge the edge

Returns: the fact that is true at the target of the edge

Throws: DataflowAnalysisException

getLastUpdateTimestamp

public int getLastUpdateTimestamp(Fact fact)

getResultFact

public Fact getResultFact(BasicBlock block)

getStartFact

public Fact getStartFact(BasicBlock block)

resultFactIterator

public Iterator<Fact> resultFactIterator()
Get an iterator over the result facts.

setLastUpdateTimestamp

public void setLastUpdateTimestamp(Fact fact, int lastUpdateTimestamp)

startIteration

public void startIteration()
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.