Skip to content

Commit

Permalink
adding new packs wjpp and wspp
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Bodden committed Jun 25, 2010
1 parent e9cf682 commit 524eb9e
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Improvements and API changes in trunk
quickly on little toy examples, disregarding the Java runtime. Of
course, such an analysis may be unsound - you get what you are asking
for.
5. Added new packs "wjpp" and "wspp" for adding pre-processors.

Improvements and API changes in version 2.4.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ protected void initializePageContainer() {

Composite jjChild = jjCreate(getPageContainer());

Composite wsopChild = wsopCreate(getPageContainer());

Composite wsopChild = wsopCreate(getPageContainer());

Composite cgChild = cgCreate(getPageContainer());

Composite wstpChild = wstpCreate(getPageContainer());
Expand Down Expand Up @@ -660,6 +664,24 @@ private void initializeEnableGroups(){
getjjjj_uceenabled_widget().getButton().addSelectionListener(this);


makeNewEnableGroup("wsop");


addToEnableGroup("wsop", getwsopenabled_widget(), "enabled");


getwsopenabled_widget().getButton().addSelectionListener(this);


makeNewEnableGroup("wsop");


addToEnableGroup("wsop", getwsopenabled_widget(), "enabled");


getwsopenabled_widget().getButton().addSelectionListener(this);


makeNewEnableGroup("cg");


Expand Down Expand Up @@ -1973,14 +1995,14 @@ private boolean createNewConfig() {
getConfig().put(getInput_Optionsallow_phantom_refs_widget().getAlias(), new Boolean(boolRes));
}

boolRes = getInput_Optionsno_jrl_widget().getButton().getSelection();
boolRes = getInput_Optionsno_bodies_for_excluded_widget().getButton().getSelection();


defBoolRes = false;


if (boolRes != defBoolRes) {
getConfig().put(getInput_Optionsno_jrl_widget().getAlias(), new Boolean(boolRes));
getConfig().put(getInput_Optionsno_bodies_for_excluded_widget().getAlias(), new Boolean(boolRes));
}

boolRes = getInput_Optionsj2me_widget().getButton().getSelection();
Expand Down Expand Up @@ -2697,6 +2719,26 @@ private boolean createNewConfig() {
getConfig().put(getjjjj_uceenabled_widget().getAlias(), new Boolean(boolRes));
}

boolRes = getwsopenabled_widget().getButton().getSelection();


defBoolRes = false;


if (boolRes != defBoolRes) {
getConfig().put(getwsopenabled_widget().getAlias(), new Boolean(boolRes));
}

boolRes = getwsopenabled_widget().getButton().getSelection();


defBoolRes = false;


if (boolRes != defBoolRes) {
getConfig().put(getwsopenabled_widget().getAlias(), new Boolean(boolRes));
}

boolRes = getcgenabled_widget().getButton().getSelection();


Expand Down Expand Up @@ -5335,6 +5377,20 @@ protected SootOption getInitialInput() {
subSectParent = jj_jj_uce_branch;


//Whole Jimple Pre-processing Pack
SootOption wsop_branch = new SootOption("Whole Jimple Pre-processing Pack", "wsop");
parent.addChild(wsop_branch);
subParent = wsop_branch;



//Whole Shimple Pre-processing Pack
SootOption wsop_branch = new SootOption("Whole Shimple Pre-processing Pack", "wsop");
parent.addChild(wsop_branch);
subParent = wsop_branch;



//Call Graph Constructor
SootOption cg_branch = new SootOption("Call Graph Constructor", "cg");
parent.addChild(cg_branch);
Expand Down Expand Up @@ -6282,14 +6338,14 @@ public BooleanOptionWidget getInput_Optionsallow_phantom_refs_widget() {
return Input_Optionsallow_phantom_refs_widget;
}

private BooleanOptionWidget Input_Optionsno_jrl_widget;
private BooleanOptionWidget Input_Optionsno_bodies_for_excluded_widget;

private void setInput_Optionsno_jrl_widget(BooleanOptionWidget widget) {
Input_Optionsno_jrl_widget = widget;
private void setInput_Optionsno_bodies_for_excluded_widget(BooleanOptionWidget widget) {
Input_Optionsno_bodies_for_excluded_widget = widget;
}

public BooleanOptionWidget getInput_Optionsno_jrl_widget() {
return Input_Optionsno_jrl_widget;
public BooleanOptionWidget getInput_Optionsno_bodies_for_excluded_widget() {
return Input_Optionsno_bodies_for_excluded_widget;
}

private BooleanOptionWidget Input_Optionsj2me_widget;
Expand Down Expand Up @@ -7030,6 +7086,26 @@ public BooleanOptionWidget getjjjj_uceenabled_widget() {
return jjjj_uceenabled_widget;
}

private BooleanOptionWidget wsopenabled_widget;

private void setwsopenabled_widget(BooleanOptionWidget widget) {
wsopenabled_widget = widget;
}

public BooleanOptionWidget getwsopenabled_widget() {
return wsopenabled_widget;
}

private BooleanOptionWidget wsopenabled_widget;

private void setwsopenabled_widget(BooleanOptionWidget widget) {
wsopenabled_widget = widget;
}

public BooleanOptionWidget getwsopenabled_widget() {
return wsopenabled_widget;
}

private BooleanOptionWidget cgenabled_widget;

private void setcgenabled_widget(BooleanOptionWidget widget) {
Expand Down Expand Up @@ -9748,7 +9824,7 @@ private Composite Input_OptionsCreate(Composite parent) {



defKey = ""+" "+""+" "+"no-jrl";
defKey = ""+" "+""+" "+"no-bodies-for-excluded";
defKey = defKey.trim();

if (isInDefList(defKey)) {
Expand All @@ -9760,7 +9836,7 @@ private Composite Input_OptionsCreate(Composite parent) {

}

setInput_Optionsno_jrl_widget(new BooleanOptionWidget(editGroupInput_Options, SWT.NONE, new OptionData("Allow Phantom References", "", "","no-jrl", "\nPrevents Soot from loading and analyzing any classes from \nexcluded packages (even in whole-program mode), except for \napplication classes and such classes that are explicitly added \nas basic-classes. ", defaultBool)));
setInput_Optionsno_bodies_for_excluded_widget(new BooleanOptionWidget(editGroupInput_Options, SWT.NONE, new OptionData("Allow Phantom References", "", "","no-bodies-for-excluded", "\nPrevents Soot from loading method bodies for all excluded \nclasses (see exclude option), even when running in whole-program \nmode. This is useful for computing a shallow points-to analysis \nthat does not, for instance, take into account the JDK. Of \ncourse, such analyses may be unsound. You get what you are \nasking for. ", defaultBool)));



Expand Down Expand Up @@ -11906,6 +11982,98 @@ private Composite jjjj_uceCreate(Composite parent) {



private Composite wsopCreate(Composite parent) {
String defKey;
String defaultString;
boolean defaultBool = false;
String defaultArray;

Group editGroupwsop = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
editGroupwsop.setLayout(layout);

editGroupwsop.setText("Whole Jimple Pre-processing Pack");

editGroupwsop.setData("id", "wsop");

String descwsop = "Whole Jimple Pre-processing Pack";
if (descwsop.length() > 0) {
Label descLabelwsop = new Label(editGroupwsop, SWT.WRAP);
descLabelwsop.setText(descwsop);
}
OptionData [] data;




defKey = "p"+" "+"wsop"+" "+"enabled";
defKey = defKey.trim();

if (isInDefList(defKey)) {
defaultBool = getBoolDef(defKey);
}
else {

defaultBool = false;

}

setwsopenabled_widget(new BooleanOptionWidget(editGroupwsop, SWT.NONE, new OptionData("Enabled", "p", "wsop","enabled", "\n", defaultBool)));




return editGroupwsop;
}



private Composite wsopCreate(Composite parent) {
String defKey;
String defaultString;
boolean defaultBool = false;
String defaultArray;

Group editGroupwsop = new Group(parent, SWT.NONE);
GridLayout layout = new GridLayout();
editGroupwsop.setLayout(layout);

editGroupwsop.setText("Whole Shimple Pre-processing Pack");

editGroupwsop.setData("id", "wsop");

String descwsop = "Whole Shimple Pre-processing Pack";
if (descwsop.length() > 0) {
Label descLabelwsop = new Label(editGroupwsop, SWT.WRAP);
descLabelwsop.setText(descwsop);
}
OptionData [] data;




defKey = "p"+" "+"wsop"+" "+"enabled";
defKey = defKey.trim();

if (isInDefList(defKey)) {
defaultBool = getBoolDef(defKey);
}
else {

defaultBool = false;

}

setwsopenabled_widget(new BooleanOptionWidget(editGroupwsop, SWT.NONE, new OptionData("Enabled", "p", "wsop","enabled", "\n", defaultBool)));




return editGroupwsop;
}



private Composite cgCreate(Composite parent) {
String defKey;
String defaultString;
Expand Down
30 changes: 30 additions & 0 deletions generated/options/soot/AntTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,36 @@ public void setenabled(boolean arg) {

}

public Object createp_wsop() {
Object ret = new PhaseOptwsop();
phaseopts.add(ret);
return ret;
}
public class PhaseOptwsop {

public void setenabled(boolean arg) {
addArg("-p");
addArg("wsop");
addArg("enabled:"+(arg?"true":"false"));
}

}

public Object createp_wsop() {
Object ret = new PhaseOptwsop();
phaseopts.add(ret);
return ret;
}
public class PhaseOptwsop {

public void setenabled(boolean arg) {
addArg("-p");
addArg("wsop");
addArg("enabled:"+(arg?"true":"false"));
}

}

public Object createp_cg() {
Object ret = new PhaseOptcg();
phaseopts.add(ret);
Expand Down
36 changes: 36 additions & 0 deletions generated/options/soot/options/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -1246,6 +1246,8 @@ public String getPhaseList() {
+padVal("jj.lp", "Local packer: minimizes number of locals")
+padVal("jj.ne", "Nop eliminator")
+padVal("jj.uce", "Unreachable code eliminator")
+padOpt("wsop", "Whole Jimple Pre-processing Pack")
+padOpt("wsop", "Whole Shimple Pre-processing Pack")
+padOpt("cg", "Call graph constructor")
+padVal("cg.cha", "Builds call graph using Class Hierarchy Analysis")
+padVal("cg.spark", "Spark points-to analysis framework")
Expand Down Expand Up @@ -1510,6 +1512,18 @@ public String getPhaseHelp( String phaseName ) {
+"\n\nRecognized options (with default values):\n"
+padOpt( "enabled (true)", "" );

if( phaseName.equals( "wsop" ) )
return "Phase "+phaseName+":\n"+
"\nThis pack allows you to insert pre-processors that are run \nbefore call-graph construction. Only enabled in whole-program \nmode. In an unmodified copy of Soot, this pack is empty."
+"\n\nRecognized options (with default values):\n"
+padOpt( "enabled (false)", "" );

if( phaseName.equals( "wsop" ) )
return "Phase "+phaseName+":\n"+
"\nThis pack allows you to insert pre-processors that are run \nbefore call-graph construction. Only enabled in whole-program \nShimple mode. In an unmodified copy of Soot, this pack is empty."
+"\n\nRecognized options (with default values):\n"
+padOpt( "enabled (false)", "" );

if( phaseName.equals( "cg" ) )
return "Phase "+phaseName+":\n"+
"\nThe Call Graph Constructor computes a call graph for whole \nprogram analysis. When this pack finishes, a call graph is \navailable in the Scene. The different phases in this pack are \ndifferent ways to construct the call graph. Exactly one phase in \nthis pack must be enabled; Soot will raise an error otherwise. "
Expand Down Expand Up @@ -2427,6 +2441,14 @@ public static String getDeclaredOptionsForPhase( String phaseName ) {
return ""
+"enabled ";

if( phaseName.equals( "wsop" ) )
return ""
+"enabled ";

if( phaseName.equals( "wsop" ) )
return ""
+"enabled ";

if( phaseName.equals( "cg" ) )
return ""
+"enabled "
Expand Down Expand Up @@ -3012,6 +3034,14 @@ public static String getDefaultOptionsForPhase( String phaseName ) {
return ""
+"enabled:true ";

if( phaseName.equals( "wsop" ) )
return ""
+"enabled:false ";

if( phaseName.equals( "wsop" ) )
return ""
+"enabled:false ";

if( phaseName.equals( "cg" ) )
return ""
+"enabled:true "
Expand Down Expand Up @@ -3493,6 +3523,8 @@ public void warnForeignPhase( String phaseName ) {
if( phaseName.equals( "jj.lp" ) ) return;
if( phaseName.equals( "jj.ne" ) ) return;
if( phaseName.equals( "jj.uce" ) ) return;
if( phaseName.equals( "wsop" ) ) return;
if( phaseName.equals( "wsop" ) ) return;
if( phaseName.equals( "cg" ) ) return;
if( phaseName.equals( "cg.cha" ) ) return;
if( phaseName.equals( "cg.spark" ) ) return;
Expand Down Expand Up @@ -3629,6 +3661,10 @@ public void warnNonexistentPhase() {
G.v().out.println( "Warning: Options exist for non-existent phase jj.ne" );
if( !PackManager.v().hasPhase( "jj.uce" ) )
G.v().out.println( "Warning: Options exist for non-existent phase jj.uce" );
if( !PackManager.v().hasPhase( "wsop" ) )
G.v().out.println( "Warning: Options exist for non-existent phase wsop" );
if( !PackManager.v().hasPhase( "wsop" ) )
G.v().out.println( "Warning: Options exist for non-existent phase wsop" );
if( !PackManager.v().hasPhase( "cg" ) )
G.v().out.println( "Warning: Options exist for non-existent phase cg" );
if( !PackManager.v().hasPhase( "cg.cha" ) )
Expand Down
Loading

0 comments on commit 524eb9e

Please sign in to comment.