Package soot.toolkits.scalar
Class CombinedDUAnalysis
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- soot.toolkits.scalar.FlowAnalysis<N,A>
-
- soot.toolkits.scalar.BackwardFlowAnalysis<Unit,FlowSet<ValueBox>>
-
- soot.toolkits.scalar.CombinedDUAnalysis
-
- All Implemented Interfaces:
CombinedAnalysis,LiveLocals,LocalDefs,LocalUses
public class CombinedDUAnalysis extends BackwardFlowAnalysis<Unit,FlowSet<ValueBox>> implements CombinedAnalysis
Analysis that computes live locals, local defs, and local uses all at once. SA, 09.09.2014: Inefficient as hell (memory). Use the distinct analyses or fix this class before using it.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.toolkits.scalar.FlowAnalysis
FlowAnalysis.Flow
-
Nested classes/interfaces inherited from interface soot.toolkits.scalar.LiveLocals
LiveLocals.Factory
-
Nested classes/interfaces inherited from interface soot.toolkits.scalar.LocalUses
LocalUses.Factory
-
-
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 CombinedDUAnalysis(UnitGraph graph)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopy(FlowSet<ValueBox> source, FlowSet<ValueBox> dest)Creates a copy of thesourceflow object indest.protected FlowSet<ValueBox>entryInitialFlow()Returns the initial flow value for entry/exit graph nodes.protected voidflowThrough(FlowSet<ValueBox> out, Unit u, FlowSet<ValueBox> in)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.List<Local>getLiveLocalsAfter(Unit u)Returns the list of Locals that are live after the specified Unit.List<Local>getLiveLocalsBefore(Unit u)Returns the list of Locals that are live before the specified Unit.List<UnitValueBoxPair>getUsesOf(Unit u)Returns a list of the Units that use the Local that is defined by a given Unit.protected voidmerge(FlowSet<ValueBox> inout, FlowSet<ValueBox> in)protected voidmerge(FlowSet<ValueBox> in1, FlowSet<ValueBox> in2, FlowSet<ValueBox> out)Compute the merge of thein1andin2sets, putting the result intoout.protected FlowSet<ValueBox>newInitialFlow()Returns the flow object corresponding to the initial values for each graph node.-
Methods inherited from class soot.toolkits.scalar.BackwardFlowAnalysis
doAnalysis, isForward
-
Methods inherited from class soot.toolkits.scalar.FlowAnalysis
copyFreshToExisting, getFlow, getFlowAfter, getFlowBefore, omissible
-
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
merge, mergeInto, treatTrapHandlersAsEntries
-
-
-
-
Constructor Detail
-
CombinedDUAnalysis
public CombinedDUAnalysis(UnitGraph graph)
-
-
Method Detail
-
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.
-
getDefsOf
public List<Unit> getDefsOf(Local l)
Description copied from interface:LocalDefsReturns the definition sites for a Local merged over all points in a method. You can assume this method never returnsnull.
-
getUsesOf
public List<UnitValueBoxPair> getUsesOf(Unit u)
Description copied from interface:LocalUsesReturns a list of the Units that use the Local that is defined by a given Unit.
-
getLiveLocalsBefore
public List<Local> getLiveLocalsBefore(Unit u)
Description copied from interface:LiveLocalsReturns the list of Locals that are live before the specified Unit.- Specified by:
getLiveLocalsBeforein interfaceLiveLocals- Parameters:
u- the Unit that defines this query.- Returns:
- a list of Locals that are live before the specified unit in the method.
-
getLiveLocalsAfter
public List<Local> getLiveLocalsAfter(Unit u)
Description copied from interface:LiveLocalsReturns the list of Locals that are live after the specified Unit.- Specified by:
getLiveLocalsAfterin interfaceLiveLocals- Parameters:
u- the Unit that defines this query.- Returns:
- a list of Locals that are live after the specified unit in the method.
-
merge
protected void merge(FlowSet<ValueBox> in1, FlowSet<ValueBox> in2, FlowSet<ValueBox> 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,FlowSet<ValueBox>>
-
flowThrough
protected void flowThrough(FlowSet<ValueBox> out, Unit u, FlowSet<ValueBox> in)
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,FlowSet<ValueBox>>- Parameters:
out- the input flowu- the current nodein- the returned flow
-
entryInitialFlow
protected FlowSet<ValueBox> entryInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the initial flow value for entry/exit graph nodes. This is equal toAbstractFlowAnalysis.newInitialFlow()- Overrides:
entryInitialFlowin classAbstractFlowAnalysis<Unit,FlowSet<ValueBox>>
-
newInitialFlow
protected FlowSet<ValueBox> newInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the flow object corresponding to the initial values for each graph node.- Specified by:
newInitialFlowin classAbstractFlowAnalysis<Unit,FlowSet<ValueBox>>
-
copy
protected void copy(FlowSet<ValueBox> source, FlowSet<ValueBox> dest)
Description copied from class:AbstractFlowAnalysisCreates a copy of thesourceflow object indest.- Specified by:
copyin classAbstractFlowAnalysis<Unit,FlowSet<ValueBox>>
-
-