Package edu.umd.cs.findbugs.ba
Class BlockTypeAnalysis
java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<BlockType>
edu.umd.cs.findbugs.ba.BlockTypeAnalysis
- All Implemented Interfaces:
DataflowAnalysis<BlockType>
Dataflow analysis to determine the nesting of catch and finally blocks within
a method.
- Author:
- David Hovemeyer
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy dataflow facts.Create empty (uninitialized) dataflow facts for one program point.getBlockOrder(CFG cfg) Return the BlockOrder specifying the order in which BasicBlocks should be visited in the main dataflow loop.voidinitEntryFact(BlockType result) Initialize the "entry" fact for the graph.booleanReturns true if the analysis is forwards, false if backwards.booleanIs the given fact the top value.voidmakeFactTop(BlockType fact) Make given fact the top value.voidMeet a dataflow fact associated with an incoming edge into another fact.booleanAre given dataflow facts the same?voidtransfer(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle end, BlockType start, BlockType result) Transfer function for the analysis.Methods inherited from class edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactAfterLocation, getFactAtLocation, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIteration
-
Constructor Details
-
BlockTypeAnalysis
Constructor.- Parameters:
dfs- a DepthFirstSearch for the method to be analyzed
-
-
Method Details
-
createFact
Description copied from interface:DataflowAnalysisCreate empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used. -
copy
Description copied from interface:DataflowAnalysisCopy dataflow facts. -
initEntryFact
Description copied from interface:DataflowAnalysisInitialize the "entry" fact for the graph.- Throws:
DataflowAnalysisException
-
makeFactTop
Description copied from interface:DataflowAnalysisMake given fact the top value. -
isTop
Description copied from interface:DataflowAnalysisIs the given fact the top value. -
isForwards
public boolean isForwards()Description copied from interface:DataflowAnalysisReturns true if the analysis is forwards, false if backwards. -
getBlockOrder
Description copied from interface:DataflowAnalysisReturn the BlockOrder specifying the order in which BasicBlocks should be visited in the main dataflow loop.- Parameters:
cfg- the CFG upon which we're performing dataflow analysis
-
same
Description copied from interface:DataflowAnalysisAre given dataflow facts the same? -
transfer
public void transfer(BasicBlock basicBlock, @CheckForNull org.apache.bcel.generic.InstructionHandle end, BlockType start, BlockType result) throws DataflowAnalysisException Description copied from interface:DataflowAnalysisTransfer function for the analysis. Taking dataflow facts at start (which might be either the entry or exit of the block, depending on whether the analysis is forwards or backwards), modify result to be the facts at the other end of the block.- Parameters:
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 block- Throws:
DataflowAnalysisException
-
meetInto
Description copied from interface:DataflowAnalysisMeet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.- Parameters:
fact- the predecessor fact (incoming edge)edge- the edge from the predecessorresult- the result fact- Throws:
DataflowAnalysisException
-