Package edu.umd.cs.findbugs.ba
Class AbstractDataflowAnalysis<Fact>
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<Fact>
-
- edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
-
- All Implemented Interfaces:
DataflowAnalysis<Fact>
- Direct Known Subclasses:
BackwardDataflowAnalysis,CallListAnalysis,ForwardDataflowAnalysis,TypeQualifierDataflowAnalysis
public abstract class AbstractDataflowAnalysis<Fact> extends BasicAbstractDataflowAnalysis<Fact>
Abstract base class providing functionality that will be useful for most dataflow analysis implementations that model instructions within basic blocks.- Author:
- David Hovemeyer
- See Also:
Dataflow,DataflowAnalysis
-
-
Constructor Summary
Constructors Constructor Description AbstractDataflowAnalysis()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description FactgetFactAfterLocation(Location location)Get the dataflow fact representing the point just after given Location.FactgetFactAtLocation(Location location)Get the dataflow fact representing the point just before given Location.abstract booleanisFactValid(Fact fact)Determine whether the given fact is valid (neither top nor bottom).voidtransfer(BasicBlock basicBlock, org.apache.bcel.generic.InstructionHandle end, Fact start, Fact result)Transfer function for the analysis.abstract voidtransferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, Fact fact)Transfer function for a single instruction.-
Methods inherited from class edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIteration
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.umd.cs.findbugs.ba.DataflowAnalysis
copy, createFact, getBlockOrder, initEntryFact, isForwards, isTop, makeFactTop, meetInto, same
-
-
-
-
Method Detail
-
transferInstruction
public abstract void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, Fact fact) throws DataflowAnalysisExceptionTransfer function for a single instruction.- Parameters:
handle- the instructionbasicBlock- the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutinesfact- which should be modified based on the instruction- Throws:
DataflowAnalysisException
-
isFactValid
@CheckReturnValue public abstract boolean isFactValid(Fact fact)
Determine whether the given fact is valid (neither top nor bottom).
-
getFactAtLocation
public Fact getFactAtLocation(Location location) throws DataflowAnalysisException
Get the dataflow fact representing the point 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.- Specified by:
getFactAtLocationin interfaceDataflowAnalysis<Fact>- Overrides:
getFactAtLocationin classBasicAbstractDataflowAnalysis<Fact>- Parameters:
location- the location- Returns:
- the fact at the point just before the location
- Throws:
DataflowAnalysisException
-
getFactAfterLocation
public Fact getFactAfterLocation(Location location) throws DataflowAnalysisException
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.- Specified by:
getFactAfterLocationin interfaceDataflowAnalysis<Fact>- Overrides:
getFactAfterLocationin classBasicAbstractDataflowAnalysis<Fact>- Parameters:
location- the location- Returns:
- the fact at the point just after the location
- Throws:
DataflowAnalysisException
-
transfer
public void transfer(BasicBlock basicBlock, @CheckForNull org.apache.bcel.generic.InstructionHandle end, Fact start, Fact 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
-
-