edu.umd.cs.findbugs.ba

Class AbstractDominatorsAnalysis

public abstract class AbstractDominatorsAnalysis extends BasicAbstractDataflowAnalysis<BitSet>

A dataflow analysis to compute dominator relationships between basic blocks. Use the AbstractDominatorsAnalysis method to get the dominator set for a given basic block. The dominator sets are represented using the java.util.BitSet class, with the individual bits corresponding to the IDs of basic blocks.

Subclasses extend this class to compute either dominators or postdominators.

An EdgeChooser may be specified to select which edges to take into account. For example, exception edges could be ignored.

Author: David Hovemeyer

See Also: DataflowAnalysis CFG BasicBlock

Constructor Summary
AbstractDominatorsAnalysis(CFG cfg, boolean ignoreExceptionEdges)
Constructor.
AbstractDominatorsAnalysis(CFG cfg, EdgeChooser edgeChooser)
Constructor.
Method Summary
voidcopy(BitSet source, BitSet dest)
BitSetcreateFact()
BitSetgetAllDominatedBy(BasicBlock dominator)
Get a bitset containing the unique IDs of all blocks in CFG dominated (or postdominated, depending on how the analysis was done) by given block.
BitSetgetAllDominatorsOf(BasicBlock block)
Get a bitset containing the unique IDs of all blocks which dominate (or postdominate) the given block.
voidinitEntryFact(BitSet result)
voidinitResultFact(BitSet result)
booleanisTop(BitSet fact)
voidmakeFactTop(BitSet fact)
voidmeetInto(BitSet fact, Edge edge, BitSet result)
booleansame(BitSet fact1, BitSet fact2)
voidtransfer(BasicBlock basicBlock, InstructionHandle end, BitSet start, BitSet result)

Constructor Detail

AbstractDominatorsAnalysis

public AbstractDominatorsAnalysis(CFG cfg, boolean ignoreExceptionEdges)
Constructor.

Parameters: cfg the CFG to compute dominator relationships for ignoreExceptionEdges true if exception edges should be ignored

AbstractDominatorsAnalysis

public AbstractDominatorsAnalysis(CFG cfg, EdgeChooser edgeChooser)
Constructor.

Parameters: cfg the CFG to compute dominator relationships for edgeChooser EdgeChooser to choose which Edges to consider significant

Method Detail

copy

public void copy(BitSet source, BitSet dest)

createFact

public BitSet createFact()

getAllDominatedBy

public BitSet getAllDominatedBy(BasicBlock dominator)
Get a bitset containing the unique IDs of all blocks in CFG dominated (or postdominated, depending on how the analysis was done) by given block.

Parameters: dominator we want to get all blocks dominated (or postdominated) by this block

Returns: BitSet of the ids of all blocks dominated by the given block

getAllDominatorsOf

public BitSet getAllDominatorsOf(BasicBlock block)
Get a bitset containing the unique IDs of all blocks which dominate (or postdominate) the given block.

Parameters: block a BasicBlock

Returns: BitSet of the unique IDs of all blocks that dominate (or postdominate) the BasicBlock

initEntryFact

public void initEntryFact(BitSet result)

initResultFact

public void initResultFact(BitSet result)

isTop

public boolean isTop(BitSet fact)

makeFactTop

public void makeFactTop(BitSet fact)

meetInto

public void meetInto(BitSet fact, Edge edge, BitSet result)

same

public boolean same(BitSet fact1, BitSet fact2)

transfer

public void transfer(BasicBlock basicBlock, InstructionHandle end, BitSet start, BitSet result)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.