Package edu.umd.cs.findbugs.ba.jsr305
Class TypeQualifierDataflowAnalysis
java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<Fact>
edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<TypeQualifierValueSet>
edu.umd.cs.findbugs.ba.jsr305.TypeQualifierDataflowAnalysis
- All Implemented Interfaces:
DataflowAnalysis<TypeQualifierValueSet>
- Direct Known Subclasses:
BackwardTypeQualifierDataflowAnalysis
,ForwardTypeQualifierDataflowAnalysis
public abstract class TypeQualifierDataflowAnalysis
extends AbstractDataflowAnalysis<TypeQualifierValueSet>
Abstract base class for type qualifier dataflow analyses.
- Author:
- David Hovemeyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final CFG
protected final org.apache.bcel.generic.ConstantPoolGen
protected final TypeQualifierValue<?>
protected final ValueNumberDataflow
protected final XMethod
-
Constructor Summary
ConstructorsConstructorDescriptionTypeQualifierDataflowAnalysis
(XMethod xmethod, CFG cfg, ValueNumberDataflow vnaDataflow, org.apache.bcel.generic.ConstantPoolGen cpg, TypeQualifierValue<?> typeQualifierValue) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
copy
(TypeQualifierValueSet source, TypeQualifierValueSet dest) Copy dataflow facts.Create empty (uninitialized) dataflow facts for one program point.void
edgeTransfer
(Edge edge, TypeQualifierValueSet fact) Edge transfer function.getSourceSinkInfoSet
(Location location) Get the set of SourceSinkInfo objects representing sources/sinks at a given Location.void
initEntryFact
(TypeQualifierValueSet result) Initialize the "entry" fact for the graph.boolean
Determine whether the given fact is valid (neither top nor bottom).boolean
isTop
(TypeQualifierValueSet fact) Is the given fact the top value.void
Make given fact the top value.void
meetInto
(TypeQualifierValueSet fact, Edge edge, TypeQualifierValueSet result) Meet a dataflow fact associated with an incoming edge into another fact.protected abstract void
propagateAcrossPhiNode
(TypeQualifierValueSet fact, ValueNumber sourceVN, ValueNumber targetVN) protected void
registerSourceSink
(SourceSinkInfo sourceSinkInfo) abstract void
This method must be called before the dataflow analysis is executed.boolean
same
(TypeQualifierValueSet fact1, TypeQualifierValueSet fact2) Are given dataflow facts the same?void
transferInstruction
(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, TypeQualifierValueSet fact) Transfer function for a single instruction.Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transfer
Methods inherited from class edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis
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
getBlockOrder, isForwards
-
Field Details
-
xmethod
-
cfg
-
vnaDataflow
-
typeQualifierValue
-
cpg
protected final org.apache.bcel.generic.ConstantPoolGen cpg
-
-
Constructor Details
-
TypeQualifierDataflowAnalysis
public TypeQualifierDataflowAnalysis(XMethod xmethod, CFG cfg, ValueNumberDataflow vnaDataflow, org.apache.bcel.generic.ConstantPoolGen cpg, TypeQualifierValue<?> typeQualifierValue) Constructor.- Parameters:
xmethod
- XMethod object containing information about the method being analyzedcfg
- the control-flow graph (CFG) of the method being analyzedvnaDataflow
- ValueNumberDataflow for the methodcpg
- the constant pool being built uptypeQualifierValue
- the TypeQualifierValue we want the dataflow analysis to check
-
-
Method Details
-
initEntryFact
Description copied from interface:DataflowAnalysis
Initialize the "entry" fact for the graph.- Throws:
DataflowAnalysisException
-
isFactValid
Description copied from class:AbstractDataflowAnalysis
Determine whether the given fact is valid (neither top nor bottom).- Specified by:
isFactValid
in classAbstractDataflowAnalysis<TypeQualifierValueSet>
-
copy
Description copied from interface:DataflowAnalysis
Copy dataflow facts. -
createFact
Description copied from interface:DataflowAnalysis
Create empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used. -
isTop
Description copied from interface:DataflowAnalysis
Is the given fact the top value. -
makeFactTop
Description copied from interface:DataflowAnalysis
Make given fact the top value. -
meetInto
public void meetInto(TypeQualifierValueSet fact, Edge edge, TypeQualifierValueSet result) throws DataflowAnalysisException Description copied from interface:DataflowAnalysis
Meet 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
-
same
Description copied from interface:DataflowAnalysis
Are given dataflow facts the same? -
edgeTransfer
Description copied from interface:DataflowAnalysis
Edge transfer function. Modify the given fact that is true on the (logical) edge source to modify it so that it is true at the (logical) edge target.A do-nothing implementation is legal, and appropriate for analyses where branches are not significant.
- Specified by:
edgeTransfer
in interfaceDataflowAnalysis<TypeQualifierValueSet>
- Overrides:
edgeTransfer
in classBasicAbstractDataflowAnalysis<TypeQualifierValueSet>
- Parameters:
edge
- the Edgefact
- a dataflow fact- Throws:
DataflowAnalysisException
-
propagateAcrossPhiNode
protected abstract void propagateAcrossPhiNode(TypeQualifierValueSet fact, ValueNumber sourceVN, ValueNumber targetVN) -
registerSourceSinkLocations
This method must be called before the dataflow analysis is executed.- Throws:
DataflowAnalysisException
-
registerSourceSink
-
getSourceSinkInfoSet
Get the set of SourceSinkInfo objects representing sources/sinks at a given Location.- Parameters:
location
- a Location- Returns:
- Set of SourceSinkInfo objects representing sources/sinks at the Location
-
transferInstruction
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, TypeQualifierValueSet fact) throws DataflowAnalysisException Description copied from class:AbstractDataflowAnalysis
Transfer function for a single instruction.- Specified by:
transferInstruction
in classAbstractDataflowAnalysis<TypeQualifierValueSet>
- 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
-