Package soot.toolkits.scalar
Class SimpleLocalDefs.FlowAssignment
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- soot.toolkits.scalar.FlowAnalysis<N,A>
-
- soot.toolkits.scalar.ForwardFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>
-
- soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment
-
- All Implemented Interfaces:
LocalDefs
- Enclosing class:
- SimpleLocalDefs
public class SimpleLocalDefs.FlowAssignment extends ForwardFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet> implements LocalDefs
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.toolkits.scalar.FlowAnalysis
FlowAnalysis.Flow
-
-
Field Summary
-
Fields inherited from class soot.toolkits.scalar.FlowAnalysis
filterUnitToAfterFlow, unitToAfterFlow
-
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
filterUnitToBeforeFlow, graph, unitToBeforeFlow
-
-
Constructor Summary
Constructors Constructor Description FlowAssignment(DirectedGraph<Unit> graph, Local[] locals, List<Unit>[] unitList, int units, boolean omitSSA)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopy(soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet source, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet dest)Creates a copy of thesourceflow object indest.protected voidflowThrough(soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in, Unit unit, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet out)Given the merge of theoutsets, compute theinset fors(or in to out, depending on direction).List<Unit>getDefsOf(Local l)Returns the definition sites for a Local merged over all points in a method.List<Unit>getDefsOfAt(Local l, Unit s)Returns the definition sites for a Local at a certain point (Unit) in a method.protected FlowAnalysis.FlowgetFlow(Unit from, Unit to)You can specify which flow set you would like to use of nodefromprotected voidmerge(soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in1, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in2, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet out)Compute the merge of thein1andin2sets, putting the result intoout.protected voidmergeInto(Unit succNode, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet inout, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in)Merges in into inout, just before node succNode.protected soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSetnewInitialFlow()Returns the flow object corresponding to the initial values for each graph node.protected booleanomissible(Unit u)If a flow node can be omitted returntrue, otherwisefalse.-
Methods inherited from class soot.toolkits.scalar.ForwardFlowAnalysis
doAnalysis, isForward
-
Methods inherited from class soot.toolkits.scalar.FlowAnalysis
copyFreshToExisting, getFlowAfter, getFlowBefore
-
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
entryInitialFlow, merge, treatTrapHandlersAsEntries
-
-
-
-
Constructor Detail
-
FlowAssignment
public FlowAssignment(DirectedGraph<Unit> graph, Local[] locals, List<Unit>[] unitList, int units, boolean omitSSA)
-
-
Method Detail
-
omissible
protected boolean omissible(Unit u)
Description copied from class:FlowAnalysisIf a flow node can be omitted returntrue, otherwisefalse. There is no guarantee a node will be omitted. A omissible node does not influence the result of an analysis. If you are unsure, don't overwrite this method- Overrides:
omissiblein classFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>- Parameters:
u- the node to check- Returns:
false
-
getFlow
protected FlowAnalysis.Flow getFlow(Unit from, Unit to)
Description copied from class:FlowAnalysisYou can specify which flow set you would like to use of nodefrom- Overrides:
getFlowin classFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>- Returns:
- Flow.OUT
-
flowThrough
protected void flowThrough(soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in, Unit unit, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet out)Description copied from class:FlowAnalysisGiven the merge of theoutsets, compute theinset fors(or in to out, depending on direction). This function often causes confusion, because the same interface is used for both forward and backward flow analyses. The first parameter is always the argument to the flow function (i.e. it is the "in" set in a forward analysis and the "out" set in a backward analysis), and the third parameter is always the result of the flow function (i.e. it is the "out" set in a forward analysis and the "in" set in a backward analysis).- Specified by:
flowThroughin classFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>- Parameters:
in- the input flowunit- the current nodeout- the returned flow
-
copy
protected void copy(soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet source, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet dest)Description copied from class:AbstractFlowAnalysisCreates a copy of thesourceflow object indest.- Specified by:
copyin classAbstractFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>
-
newInitialFlow
protected soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet newInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the flow object corresponding to the initial values for each graph node.- Specified by:
newInitialFlowin classAbstractFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>
-
mergeInto
protected void mergeInto(Unit succNode, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet inout, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in)
Description copied from class:AbstractFlowAnalysisMerges in into inout, just before node succNode.- Overrides:
mergeIntoin classAbstractFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>
-
merge
protected void merge(soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in1, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet in2, soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet out)Description copied from class:AbstractFlowAnalysisCompute the merge of thein1andin2sets, putting the result intoout. The behavior of this function depends on the implementation ( it may be necessary to check whetherin1andin2are equal or aliased ). Used by the doAnalysis method.- Specified by:
mergein classAbstractFlowAnalysis<Unit,soot.toolkits.scalar.SimpleLocalDefs.FlowAssignment.FlowBitSet>
-
getDefsOfAt
public List<Unit> getDefsOfAt(Local l, Unit s)
Description copied from interface:LocalDefsReturns the definition sites for a Local at a certain point (Unit) in a method. You can assume this method never returnsnull.- Specified by:
getDefsOfAtin interfaceLocalDefs- Parameters:
l- the Local in question.s- a unit that specifies the method context (location) to query for the definitions of the Local.- Returns:
- a list of Units where the local is defined in the current method context. If there are no uses an empty list will returned.
-
-