| 1 2 20 21 22 23 package soot.options; 24 import java.util.*; 25 26 27 public class SIOptions 28 { 29 private Map options; 30 31 public SIOptions( Map options ) { 32 this.options = options; 33 } 34 35 41 public boolean enabled() { 42 return soot.PhaseOptions.getBoolean( options, "enabled" ); 43 } 44 45 56 public boolean rerun_jb() { 57 return soot.PhaseOptions.getBoolean( options, "rerun-jb" ); 58 } 59 60 69 public boolean insert_null_checks() { 70 return soot.PhaseOptions.getBoolean( options, "insert-null-checks" ); 71 } 72 73 92 public boolean insert_redundant_casts() { 93 return soot.PhaseOptions.getBoolean( options, "insert-redundant-casts" ); 94 } 95 96 105 public int max_container_size() { 106 return soot.PhaseOptions.getInt( options, "max-container-size" ); 107 } 108 109 118 public int max_inlinee_size() { 119 return soot.PhaseOptions.getInt( options, "max-inlinee-size" ); 120 } 121 122 130 public float expansion_factor() { 131 return soot.PhaseOptions.getFloat( options, "expansion-factor" ); 132 } 133 134 public static final int allowed_modifier_changes_unsafe = 1; 135 public static final int allowed_modifier_changes_safe = 2; 136 public static final int allowed_modifier_changes_none = 3; 137 143 public int allowed_modifier_changes() { 144 String s = soot.PhaseOptions.getString( options, "allowed-modifier-changes" ); 145 146 if( s.equalsIgnoreCase( "unsafe" ) ) 147 return allowed_modifier_changes_unsafe; 148 149 if( s.equalsIgnoreCase( "safe" ) ) 150 return allowed_modifier_changes_safe; 151 152 if( s.equalsIgnoreCase( "none" ) ) 153 return allowed_modifier_changes_none; 154 155 throw new RuntimeException ( "Invalid value "+s+" of phase option allowed-modifier-changes" ); 156 } 157 158 } 159 | Popular Tags |