Package soot.toolkits.scalar
Class ConstantInitializerToTagTransformer
- java.lang.Object
-
- soot.Transformer
-
- soot.SceneTransformer
-
- soot.toolkits.scalar.ConstantInitializerToTagTransformer
-
public class ConstantInitializerToTagTransformer extends SceneTransformer
This is the reverse operation of theConstantValueToInitializerTransformer. We scan for<clinit>methods that initialize a final field with a constant value and create aConstantValueTagfrom this value. Afterwards, the assignment in the<clinit>method is removed. If<clinit>runs empty, it is deleted as well.- Author:
- Steven Arzt
-
-
Constructor Summary
Constructors Constructor Description ConstantInitializerToTagTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidinternalTransform(String phaseName, Map<String,String> options)Performs the transformation on the Scene, under the given phaseName and with the given Options.voidtransformClass(SootClass sc, boolean removeAssignments)Transforms the given class, i.e.static ConstantInitializerToTagTransformerv()-
Methods inherited from class soot.SceneTransformer
transform, transform, transform
-
-
-
-
Method Detail
-
v
public static ConstantInitializerToTagTransformer v()
-
internalTransform
protected void internalTransform(String phaseName, Map<String,String> options)
Description copied from class:SceneTransformerPerforms the transformation on the Scene, under the given phaseName and with the given Options.- Specified by:
internalTransformin classSceneTransformer
-
transformClass
public void transformClass(SootClass sc, boolean removeAssignments)
Transforms the given class, i.e. scans for a<clinit>method and generates new constant value tags for all constant assignments to static final fields.- Parameters:
sc- The class to transformremoveAssignments- True if the assignments inside the<clinit>method shall be removed, otherwise false
-
-