1 2 20 21 22 23 package soot.options; 24 import java.util.*; 25 26 27 public class LCMOptions 28 { 29 private Map options; 30 31 public LCMOptions( Map options ) { 32 this.options = options; 33 } 34 35 41 public boolean enabled() { 42 return soot.PhaseOptions.getBoolean( options, "enabled" ); 43 } 44 45 52 public boolean unroll() { 53 return soot.PhaseOptions.getBoolean( options, "unroll" ); 54 } 55 56 77 public boolean naive_side_effect() { 78 return soot.PhaseOptions.getBoolean( options, "naive-side-effect" ); 79 } 80 81 public static final int safety_safe = 1; 82 public static final int safety_medium = 2; 83 public static final int safety_unsafe = 3; 84 91 public int safety() { 92 String s = soot.PhaseOptions.getString( options, "safety" ); 93 94 if( s.equalsIgnoreCase( "safe" ) ) 95 return safety_safe; 96 97 if( s.equalsIgnoreCase( "medium" ) ) 98 return safety_medium; 99 100 if( s.equalsIgnoreCase( "unsafe" ) ) 101 return safety_unsafe; 102 103 throw new RuntimeException ( "Invalid value "+s+" of phase option safety" ); 104 } 105 106 } 107 | Popular Tags |