public class Shimple
extends java.lang.Object
This should normally be used in conjunction with the constructor methods from soot.jimple.Jimple.
Miscellaneous utility functions are also available in this class.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
IFALIAS |
static java.lang.String |
MAYMODIFY |
static java.lang.String |
PHASE |
static java.lang.String |
PHI |
static java.lang.String |
PI |
Constructor and Description |
---|
Shimple(Singletons.Global g) |
Modifier and Type | Method and Description |
---|---|
static Local |
getLhsLocal(Unit unit)
Returns the corresponding left Local if the unit is a Shimple node,
null otherwise.
|
static PhiExpr |
getPhiExpr(Unit unit)
Returns the corresponding PhiExpr if the unit is a Phi node,
null otherwise.
|
static PiExpr |
getPiExpr(Unit unit) |
static boolean |
isPhiExpr(Value value)
Returns true if the value is a Phi expression, false otherwise.
|
static boolean |
isPhiNode(Unit unit)
Returns true if the unit is a Phi node, false otherwise.
|
static boolean |
isPiExpr(Value value) |
static boolean |
isPiNode(Unit unit) |
ShimpleBody |
newBody(Body b)
Returns a ShimpleBody constructed from b, using default phase
options.
|
ShimpleBody |
newBody(Body b,
java.util.Map<java.lang.String,java.lang.String> options)
Returns a ShimpleBody constructed from b, using provided option
Map.
|
ShimpleBody |
newBody(SootMethod m)
Returns an empty ShimpleBody associated with method m, using
default phase options.
|
ShimpleBody |
newBody(SootMethod m,
java.util.Map<java.lang.String,java.lang.String> options)
Returns an empty ShimpleBody associated with method m, using
provided option map.
|
JimpleBody |
newJimpleBody(ShimpleBody body)
Constructs a JimpleBody from a ShimpleBody.
|
PhiExpr |
newPhiExpr(java.util.List<Value> args,
java.util.List<Unit> preds)
Create a PhiExpr with the provided list of Values (Locals or
Constants) and the corresponding control flow predecessor
Blocks.
|
PhiExpr |
newPhiExpr(Local leftLocal,
java.util.List<Block> preds)
Create a trivial PhiExpr, where preds are an ordered list of
the control predecessor Blocks of the Phi expression.
|
PiExpr |
newPiExpr(Local local,
Unit predicate,
java.lang.Object targetKey) |
static void |
redirectPointers(Unit oldLocation,
Unit newLocation)
Redirects PhiExpr pointers to the given Unit to the new Unit.
|
static void |
redirectToPreds(Body body,
Unit remove)
If you are removing a Unit from a Unit chain which contains
PhiExpr's, you might want to call this utility function in
order to update any PhiExpr pointers to the Unit to point to
the Unit's predecessor(s).
|
static Shimple |
v() |
public static final java.lang.String IFALIAS
public static final java.lang.String MAYMODIFY
public static final java.lang.String PHI
public static final java.lang.String PI
public static final java.lang.String PHASE
public static Shimple v()
public ShimpleBody newBody(SootMethod m)
public ShimpleBody newBody(SootMethod m, java.util.Map<java.lang.String,java.lang.String> options)
public ShimpleBody newBody(Body b)
public ShimpleBody newBody(Body b, java.util.Map<java.lang.String,java.lang.String> options)
public PhiExpr newPhiExpr(Local leftLocal, java.util.List<Block> preds)
public PhiExpr newPhiExpr(java.util.List<Value> args, java.util.List<Unit> preds)
public JimpleBody newJimpleBody(ShimpleBody body)
soot.options.ShimpleOptions
public static boolean isPhiExpr(Value value)
public static boolean isPhiNode(Unit unit)
public static PhiExpr getPhiExpr(Unit unit)
public static boolean isPiExpr(Value value)
public static boolean isPiNode(Unit unit)
public static Local getLhsLocal(Unit unit)
public static void redirectToPreds(Body body, Unit remove)
Normally you should not have to call this function directly, since patching is taken care of Shimple's internal implementation of PatchingChain.