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
Fields Modifier and Type Field Description protected CFGcfgprotected org.apache.bcel.generic.ConstantPoolGencpgprotected TypeQualifierValue<?>typeQualifierValueprotected ValueNumberDataflowvnaDataflowprotected XMethodxmethod
-
Constructor Summary
Constructors Constructor Description TypeQualifierDataflowAnalysis(XMethod xmethod, CFG cfg, ValueNumberDataflow vnaDataflow, org.apache.bcel.generic.ConstantPoolGen cpg, TypeQualifierValue<?> typeQualifierValue)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidcopy(TypeQualifierValueSet source, TypeQualifierValueSet dest)Copy dataflow facts.TypeQualifierValueSetcreateFact()Create empty (uninitialized) dataflow facts for one program point.voidedgeTransfer(Edge edge, TypeQualifierValueSet fact)Edge transfer function.java.util.Set<SourceSinkInfo>getSourceSinkInfoSet(Location location)Get the set of SourceSinkInfo objects representing sources/sinks at a given Location.voidinitEntryFact(TypeQualifierValueSet result)Initialize the "entry" fact for the graph.booleanisFactValid(TypeQualifierValueSet fact)Determine whether the given fact is valid (neither top nor bottom).booleanisTop(TypeQualifierValueSet fact)Is the given fact the top value.voidmakeFactTop(TypeQualifierValueSet fact)Make given fact the top value.voidmeetInto(TypeQualifierValueSet fact, Edge edge, TypeQualifierValueSet result)Meet a dataflow fact associated with an incoming edge into another fact.protected abstract voidpropagateAcrossPhiNode(TypeQualifierValueSet fact, ValueNumber sourceVN, ValueNumber targetVN)protected voidregisterSourceSink(SourceSinkInfo sourceSinkInfo)abstract voidregisterSourceSinkLocations()This method must be called before the dataflow analysis is executed.booleansame(TypeQualifierValueSet fact1, TypeQualifierValueSet fact2)Are given dataflow facts the same?voidtransferInstruction(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 Detail
-
xmethod
protected final XMethod xmethod
-
cfg
protected final CFG cfg
-
vnaDataflow
protected final ValueNumberDataflow vnaDataflow
-
typeQualifierValue
protected final TypeQualifierValue<?> typeQualifierValue
-
cpg
protected final org.apache.bcel.generic.ConstantPoolGen cpg
-
-
Constructor Detail
-
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 Detail
-
initEntryFact
public void initEntryFact(TypeQualifierValueSet result) throws DataflowAnalysisException
Description copied from interface:DataflowAnalysisInitialize the "entry" fact for the graph.- Throws:
DataflowAnalysisException
-
isFactValid
public boolean isFactValid(TypeQualifierValueSet fact)
Description copied from class:AbstractDataflowAnalysisDetermine whether the given fact is valid (neither top nor bottom).- Specified by:
isFactValidin classAbstractDataflowAnalysis<TypeQualifierValueSet>
-
copy
public void copy(TypeQualifierValueSet source, TypeQualifierValueSet dest)
Description copied from interface:DataflowAnalysisCopy dataflow facts.
-
createFact
public TypeQualifierValueSet 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.
-
isTop
public boolean isTop(TypeQualifierValueSet fact)
Description copied from interface:DataflowAnalysisIs the given fact the top value.
-
makeFactTop
public void makeFactTop(TypeQualifierValueSet fact)
Description copied from interface:DataflowAnalysisMake given fact the top value.
-
meetInto
public void meetInto(TypeQualifierValueSet fact, Edge edge, TypeQualifierValueSet result) throws DataflowAnalysisException
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
-
same
public boolean same(TypeQualifierValueSet fact1, TypeQualifierValueSet fact2)
Description copied from interface:DataflowAnalysisAre given dataflow facts the same?
-
edgeTransfer
public void edgeTransfer(Edge edge, TypeQualifierValueSet fact) throws DataflowAnalysisException
Description copied from interface:DataflowAnalysisEdge 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:
edgeTransferin interfaceDataflowAnalysis<TypeQualifierValueSet>- Overrides:
edgeTransferin classBasicAbstractDataflowAnalysis<TypeQualifierValueSet>- Parameters:
edge- the Edgefact- a dataflow fact- Throws:
DataflowAnalysisException
-
propagateAcrossPhiNode
protected abstract void propagateAcrossPhiNode(TypeQualifierValueSet fact, ValueNumber sourceVN, ValueNumber targetVN)
-
registerSourceSinkLocations
public abstract void registerSourceSinkLocations() throws DataflowAnalysisExceptionThis method must be called before the dataflow analysis is executed.- Throws:
DataflowAnalysisException
-
registerSourceSink
protected void registerSourceSink(SourceSinkInfo sourceSinkInfo)
-
getSourceSinkInfoSet
public java.util.Set<SourceSinkInfo> getSourceSinkInfoSet(Location location)
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 DataflowAnalysisExceptionDescription copied from class:AbstractDataflowAnalysisTransfer function for a single instruction.- Specified by:
transferInstructionin 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
-
-