diff --git a/CHANGES b/CHANGES index 1dc6980c409..5dbd0ae6f52 100644 --- a/CHANGES +++ b/CHANGES @@ -50,7 +50,10 @@ Improvements and API changes in trunk The code was contributed to Soot by Richard (Xiao) Xiao. Thanks for this! You can find the code in soot.jimple.spark.geom. There are new phase options in cg.spark to enable and configure this - analysis. + analysis. +9. Improved support for custom entry points in the points-to analysis. +10.Added option allowing putiry analysis to add a "Pure" bytecode + attribute for pure methods. Improvements and API changes in version 2.4.0 diff --git a/generated/options/soot/AntTask.java b/generated/options/soot/AntTask.java index 9d0542b9974..ff78142e6f7 100644 --- a/generated/options/soot/AntTask.java +++ b/generated/options/soot/AntTask.java @@ -1972,6 +1972,12 @@ public void setprint(boolean arg) { addArg("print:"+(arg?"true":"false")); } + public void setannotate(boolean arg) { + addArg("-p"); + addArg("wjap.purity"); + addArg("annotate:"+(arg?"true":"false")); + } + public void setverbose(boolean arg) { addArg("-p"); addArg("wjap.purity"); diff --git a/generated/options/soot/options/Options.java b/generated/options/soot/options/Options.java index e6d51b5c162..a9dcc6cc1e8 100644 --- a/generated/options/soot/options/Options.java +++ b/generated/options/soot/options/Options.java @@ -1675,7 +1675,7 @@ public String getPhaseHelp( String phaseName ) { +padOpt( "geom-dump-verbose ()", "Filename for detailed execution log" ) +padOpt( "geom-verify-name ()", "Filename for verification file" ) - +padOpt( "geom-eval (0)", "precision evaluation methodologies" ) + +padOpt( "geom-eval (0)", "Precision evaluation methodologies" ) +padOpt( "geom-trans (false)", "Transform to context-insensitive result" ) +padOpt( "geom-frac-base (40)", "Fractional parameter for precision/performance trade-off" ) +padOpt( "geom-blocking (true)", "Enable blocking strategy for recursive calls" ) @@ -1951,6 +1951,7 @@ public String getPhaseHelp( String phaseName ) { +padOpt( "dump-cg (false)", "" ) +padOpt( "dump-intra (false)", "" ) +padOpt( "print (true)", "" ) + +padOpt( "annotate (true)", "Marks pure methods with a purity bytecode attribute" ) +padOpt( "verbose (false)", "" ); if( phaseName.equals( "shimple" ) ) @@ -2680,6 +2681,7 @@ public static String getDeclaredOptionsForPhase( String phaseName ) { +"dump-cg " +"dump-intra " +"print " + +"annotate " +"verbose "; if( phaseName.equals( "shimple" ) ) @@ -3283,6 +3285,7 @@ public static String getDefaultOptionsForPhase( String phaseName ) { +"dump-cg:false " +"dump-intra:false " +"print:true " + +"annotate:true " +"verbose:false "; if( phaseName.equals( "shimple" ) ) diff --git a/generated/options/soot/options/PurityOptions.java b/generated/options/soot/options/PurityOptions.java index 19e79931d9c..d5c7d37ea85 100644 --- a/generated/options/soot/options/PurityOptions.java +++ b/generated/options/soot/options/PurityOptions.java @@ -82,6 +82,16 @@ public boolean print() { return soot.PhaseOptions.getBoolean( options, "print" ); } + /** Annotate class files -- + + * Marks pure methods with a purity bytecode attribute. + + * + */ + public boolean annotate() { + return soot.PhaseOptions.getBoolean( options, "annotate" ); + } + /** Be (quite) verbose -- * . diff --git a/generated/options/soot/options/SparkOptions.java b/generated/options/soot/options/SparkOptions.java index ebb742097c7..5a5f9f8e880 100644 --- a/generated/options/soot/options/SparkOptions.java +++ b/generated/options/soot/options/SparkOptions.java @@ -481,7 +481,7 @@ public int passes() { /** Precision evaluation methodologies -- - * precision evaluation methodologies. + * Precision evaluation methodologies. * We internally provide some precision evaluation * methodologies, and classify the evaluation strength into three diff --git a/src/soot/jimple/toolkits/annotation/purity/PurityInterproceduralAnalysis.java b/src/soot/jimple/toolkits/annotation/purity/PurityInterproceduralAnalysis.java index 94cb6889021..5b9051f6ed4 100644 --- a/src/soot/jimple/toolkits/annotation/purity/PurityInterproceduralAnalysis.java +++ b/src/soot/jimple/toolkits/annotation/purity/PurityInterproceduralAnalysis.java @@ -290,6 +290,8 @@ public boolean want(SootMethod method) { (new String(isPure?"yes":"no")).getBytes())); */ m.addTag(new StringTag("purity: "+(isPure?"pure":"impure"))); + if(isPure && opts.annotate()) + m.addTag(new GenericAttribute("Pure", new byte[0])); if (opts.print()) G.v().out.println(" |- method "+m.toString()+" is "+(isPure?"pure":"impure")); diff --git a/src/soot/options/soot_options.xml b/src/soot/options/soot_options.xml index 3c81f0b8e54..95a028985e1 100644 --- a/src/soot/options/soot_options.xml +++ b/src/soot/options/soot_options.xml @@ -3852,6 +3852,12 @@ Alexandru Salcianu and Martin Rinard. print true + + Annotate class files + Marks pure methods with a purity bytecode attribute + annotate + true + Be (quite) verbose verbose