Package soot.jimple.toolkits.scalar.pre
Class SootFilter
- java.lang.Object
-
- soot.jimple.toolkits.scalar.pre.SootFilter
-
public class SootFilter extends Object
Allows easy filtering/wrapping of Soot objects. Operations that are done very often are grouped here.
-
-
Constructor Summary
Constructors Constructor Description SootFilter()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Valuebinop(Value val)only lets binary expression through.static ValuebinopRhs(Unit unit)only lets binary RHS through.static ValueconcreteRef(Value val)only lets concrete references through.static EquivalentValueequiVal(Value val)wraps a value into a EquivalentValue.static ValuegetEquivalentValueRoot(Value val)returns the Value of an EquivalentValue.static booleanisInvoke(Value val)returns true, ifvalis an invoke.static booleanisLocal(Value val)returns true, ifvalis a Local.static Valuelocal(Value val)filters out Locals.
returnsnullifvalis null.static ValuenoExceptionThrowing(Value val)filters out Exception-throwing Values.static ValuenoExceptionThrowingRhs(Unit unit)filters out RHS that don't throw any exception.static ValuenoInvoke(Value val)filters out Invokes.
returnsnullifvalis null.static ValuenoInvokeRhs(Unit unit)filters out RHS that aren't invokes.static ValuenoLocal(Value val)only lets non-Locals through.
returnsnullifvalis null.static Valuerhs(Unit unit)filters out the RHS of an assignmentStmt.static booleanthrowsException(Value val)a (probably) conservative way of telling if a Value throws an exception or not.
-
-
-
Method Detail
-
equiVal
public static EquivalentValue equiVal(Value val)
wraps a value into a EquivalentValue. returnsnullifvalis null.- Parameters:
val- the Value to wrap.- Returns:
- the EquivalentValue containing val.
-
rhs
public static Value rhs(Unit unit)
filters out the RHS of an assignmentStmt.- Parameters:
unit- a Unit from which to extract the RHS.- Returns:
- the RHS-Value of
unitornullifunitwasn't an assignment-stmt.
-
binop
public static Value binop(Value val)
only lets binary expression through.- Parameters:
val- the Value to test for.- Returns:
valif it is a binary expression. otherwisenull.
-
binopRhs
public static Value binopRhs(Unit unit)
only lets binary RHS through.- Parameters:
unit- the Unit to test for.- Returns:
- the rhs of the current unit, if
unitis an AssigStmt and its RHS is a binary expression. otherwisenull.
-
concreteRef
public static Value concreteRef(Value val)
only lets concrete references through. A concrete reference is either an array-ref or a field-ref.
returnsnullifvalalready was null.- Parameters:
val- the Value to test for.- Returns:
- the
valif it was a concrete reference. otherwisenull.
-
noExceptionThrowing
public static Value noExceptionThrowing(Value val)
filters out Exception-throwing Values. This method is perhaps conservative.
returnsnullifvalis null.- Parameters:
val- the Value to test for.- Returns:
valif val doesn't throw any exception, ornullotherwise.
-
noExceptionThrowingRhs
public static Value noExceptionThrowingRhs(Unit unit)
filters out RHS that don't throw any exception.- Parameters:
unit- the Unit to test.- Returns:
- the rhs, if
unitis an assignment-stmt and can't throw any exception.
-
noInvokeRhs
public static Value noInvokeRhs(Unit unit)
filters out RHS that aren't invokes.- Parameters:
unit- the Unit to look at.- Returns:
- the RHS of
unitif it is an assignment-stmt, and its RHS is not an invoke.
-
isInvoke
public static boolean isInvoke(Value val)
returns true, ifvalis an invoke.- Parameters:
val- the Value to inspect.- Returns:
- true if
valis an invoke.
-
noInvoke
public static Value noInvoke(Value val)
filters out Invokes.
returnsnullifvalis null.- Parameters:
val- the Value to inspect- Returns:
val, if val is not an invoke,nullotherwise.
-
local
public static Value local(Value val)
filters out Locals.
returnsnullifvalis null.- Parameters:
val- the Value to look at.- Returns:
val, if it is a Local,nullotherwise.
-
noLocal
public static Value noLocal(Value val)
only lets non-Locals through.
returnsnullifvalis null.- Parameters:
val- the Value to look at.- Returns:
val, if it is not a Local,nullotherwise.
-
isLocal
public static boolean isLocal(Value val)
returns true, ifvalis a Local.
-
getEquivalentValueRoot
public static Value getEquivalentValueRoot(Value val)
returns the Value of an EquivalentValue. If there are several EquivalentValues stacked one into another, gets the deepest Value.
returnsnullifvalis null.- Parameters:
val- the Value to inspect.- Returns:
- val, if val is not an EquivalentValue, or the deepest Value otherwise.
-
throwsException
public static boolean throwsException(Value val)
a (probably) conservative way of telling if a Value throws an exception or not.
-
-