1 2 20 21 22 23 package soot.options; 24 import java.util.*; 25 26 27 public class PaddleOptions 28 { 29 private Map options; 30 31 public PaddleOptions( 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 verbose() { 53 return soot.PhaseOptions.getBoolean( options, "verbose" ); 54 } 55 56 63 public boolean bdd() { 64 return soot.PhaseOptions.getBoolean( options, "bdd" ); 65 } 66 67 74 public boolean dynamic_order() { 75 return soot.PhaseOptions.getBoolean( options, "dynamic-order" ); 76 } 77 78 84 public boolean profile() { 85 return soot.PhaseOptions.getBoolean( options, "profile" ); 86 } 87 88 95 public boolean ignore_types() { 96 return soot.PhaseOptions.getBoolean( options, "ignore-types" ); 97 } 98 99 110 public boolean pre_jimplify() { 111 return soot.PhaseOptions.getBoolean( options, "pre-jimplify" ); 112 } 113 114 125 public boolean context_heap() { 126 return soot.PhaseOptions.getBoolean( options, "context-heap" ); 127 } 128 129 137 public boolean rta() { 138 return soot.PhaseOptions.getBoolean( options, "rta" ); 139 } 140 141 152 public boolean field_based() { 153 return soot.PhaseOptions.getBoolean( options, "field-based" ); 154 } 155 156 164 public boolean types_for_sites() { 165 return soot.PhaseOptions.getBoolean( options, "types-for-sites" ); 166 } 167 168 176 public boolean merge_stringbuffer() { 177 return soot.PhaseOptions.getBoolean( options, "merge-stringbuffer" ); 178 } 179 180 191 public boolean string_constants() { 192 return soot.PhaseOptions.getBoolean( options, "string-constants" ); 193 } 194 195 202 public boolean simulate_natives() { 203 return soot.PhaseOptions.getBoolean( options, "simulate-natives" ); 204 } 205 206 218 public boolean global_nodes_in_natives() { 219 return soot.PhaseOptions.getBoolean( options, "global-nodes-in-natives" ); 220 } 221 222 230 public boolean simple_edges_bidirectional() { 231 return soot.PhaseOptions.getBoolean( options, "simple-edges-bidirectional" ); 232 } 233 234 246 public boolean this_edges() { 247 return soot.PhaseOptions.getBoolean( options, "this-edges" ); 248 } 249 250 259 public boolean precise_newinstance() { 260 return soot.PhaseOptions.getBoolean( options, "precise-newinstance" ); 261 } 262 263 271 public boolean context_counts() { 272 return soot.PhaseOptions.getBoolean( options, "context-counts" ); 273 } 274 275 282 public boolean total_context_counts() { 283 return soot.PhaseOptions.getBoolean( options, "total-context-counts" ); 284 } 285 286 294 public boolean method_context_counts() { 295 return soot.PhaseOptions.getBoolean( options, "method-context-counts" ); 296 } 297 298 306 public boolean set_mass() { 307 return soot.PhaseOptions.getBoolean( options, "set-mass" ); 308 } 309 310 317 public boolean number_nodes() { 318 return soot.PhaseOptions.getBoolean( options, "number-nodes" ); 319 } 320 321 328 public int order() { 329 return soot.PhaseOptions.getInt( options, "order" ); 330 } 331 332 340 public int k() { 341 return soot.PhaseOptions.getInt( options, "k" ); 342 } 343 344 public static final int conf_ofcg = 1; 345 public static final int conf_cha = 2; 346 public static final int conf_cha_aot = 3; 347 public static final int conf_ofcg_aot = 4; 348 public static final int conf_cha_context_aot = 5; 349 public static final int conf_ofcg_context_aot = 6; 350 public static final int conf_cha_context = 7; 351 public static final int conf_ofcg_context = 8; 352 359 public int conf() { 360 String s = soot.PhaseOptions.getString( options, "conf" ); 361 362 if( s.equalsIgnoreCase( "ofcg" ) ) 363 return conf_ofcg; 364 365 if( s.equalsIgnoreCase( "cha" ) ) 366 return conf_cha; 367 368 if( s.equalsIgnoreCase( "cha-aot" ) ) 369 return conf_cha_aot; 370 371 if( s.equalsIgnoreCase( "ofcg-aot" ) ) 372 return conf_ofcg_aot; 373 374 if( s.equalsIgnoreCase( "cha-context-aot" ) ) 375 return conf_cha_context_aot; 376 377 if( s.equalsIgnoreCase( "ofcg-context-aot" ) ) 378 return conf_ofcg_context_aot; 379 380 if( s.equalsIgnoreCase( "cha-context" ) ) 381 return conf_cha_context; 382 383 if( s.equalsIgnoreCase( "ofcg-context" ) ) 384 return conf_ofcg_context; 385 386 throw new RuntimeException ( "Invalid value "+s+" of phase option conf" ); 387 } 388 389 public static final int q_auto = 1; 390 public static final int q_trad = 2; 391 public static final int q_bdd = 3; 392 public static final int q_debug = 4; 393 public static final int q_trace = 5; 394 public static final int q_numtrace = 6; 395 402 public int q() { 403 String s = soot.PhaseOptions.getString( options, "q" ); 404 405 if( s.equalsIgnoreCase( "auto" ) ) 406 return q_auto; 407 408 if( s.equalsIgnoreCase( "trad" ) ) 409 return q_trad; 410 411 if( s.equalsIgnoreCase( "bdd" ) ) 412 return q_bdd; 413 414 if( s.equalsIgnoreCase( "debug" ) ) 415 return q_debug; 416 417 if( s.equalsIgnoreCase( "trace" ) ) 418 return q_trace; 419 420 if( s.equalsIgnoreCase( "numtrace" ) ) 421 return q_numtrace; 422 423 throw new RuntimeException ( "Invalid value "+s+" of phase option q" ); 424 } 425 426 public static final int backend_buddy = 1; 427 public static final int backend_cudd = 2; 428 public static final int backend_sable = 3; 429 public static final int backend_javabdd = 4; 430 public static final int backend_none = 5; 431 438 public int backend() { 439 String s = soot.PhaseOptions.getString( options, "backend" ); 440 441 if( s.equalsIgnoreCase( "buddy" ) ) 442 return backend_buddy; 443 444 if( s.equalsIgnoreCase( "cudd" ) ) 445 return backend_cudd; 446 447 if( s.equalsIgnoreCase( "sable" ) ) 448 return backend_sable; 449 450 if( s.equalsIgnoreCase( "javabdd" ) ) 451 return backend_javabdd; 452 453 if( s.equalsIgnoreCase( "none" ) ) 454 return backend_none; 455 456 throw new RuntimeException ( "Invalid value "+s+" of phase option backend" ); 457 } 458 459 public static final int context_insens = 1; 460 public static final int context_1cfa = 2; 461 public static final int context_kcfa = 3; 462 public static final int context_objsens = 4; 463 public static final int context_kobjsens = 5; 464 public static final int context_uniqkobjsens = 6; 465 472 public int context() { 473 String s = soot.PhaseOptions.getString( options, "context" ); 474 475 if( s.equalsIgnoreCase( "insens" ) ) 476 return context_insens; 477 478 if( s.equalsIgnoreCase( "1cfa" ) ) 479 return context_1cfa; 480 481 if( s.equalsIgnoreCase( "kcfa" ) ) 482 return context_kcfa; 483 484 if( s.equalsIgnoreCase( "objsens" ) ) 485 return context_objsens; 486 487 if( s.equalsIgnoreCase( "kobjsens" ) ) 488 return context_kobjsens; 489 490 if( s.equalsIgnoreCase( "uniqkobjsens" ) ) 491 return context_uniqkobjsens; 492 493 throw new RuntimeException ( "Invalid value "+s+" of phase option context" ); 494 } 495 496 public static final int propagator_auto = 1; 497 public static final int propagator_iter = 2; 498 public static final int propagator_worklist = 3; 499 public static final int propagator_alias = 4; 500 public static final int propagator_bdd = 5; 501 public static final int propagator_incbdd = 6; 502 509 public int propagator() { 510 String s = soot.PhaseOptions.getString( options, "propagator" ); 511 512 if( s.equalsIgnoreCase( "auto" ) ) 513 return propagator_auto; 514 515 if( s.equalsIgnoreCase( "iter" ) ) 516 return propagator_iter; 517 518 if( s.equalsIgnoreCase( "worklist" ) ) 519 return propagator_worklist; 520 521 if( s.equalsIgnoreCase( "alias" ) ) 522 return propagator_alias; 523 524 if( s.equalsIgnoreCase( "bdd" ) ) 525 return propagator_bdd; 526 527 if( s.equalsIgnoreCase( "incbdd" ) ) 528 return propagator_incbdd; 529 530 throw new RuntimeException ( "Invalid value "+s+" of phase option propagator" ); 531 } 532 533 public static final int set_impl_hash = 1; 534 public static final int set_impl_bit = 2; 535 public static final int set_impl_hybrid = 3; 536 public static final int set_impl_array = 4; 537 public static final int set_impl_double = 5; 538 544 public int set_impl() { 545 String s = soot.PhaseOptions.getString( options, "set-impl" ); 546 547 if( s.equalsIgnoreCase( "hash" ) ) 548 return set_impl_hash; 549 550 if( s.equalsIgnoreCase( "bit" ) ) 551 return set_impl_bit; 552 553 if( s.equalsIgnoreCase( "hybrid" ) ) 554 return set_impl_hybrid; 555 556 if( s.equalsIgnoreCase( "array" ) ) 557 return set_impl_array; 558 559 if( s.equalsIgnoreCase( "double" ) ) 560 return set_impl_double; 561 562 throw new RuntimeException ( "Invalid value "+s+" of phase option set-impl" ); 563 } 564 565 public static final int double_set_old_hash = 1; 566 public static final int double_set_old_bit = 2; 567 public static final int double_set_old_hybrid = 3; 568 public static final int double_set_old_array = 4; 569 578 public int double_set_old() { 579 String s = soot.PhaseOptions.getString( options, "double-set-old" ); 580 581 if( s.equalsIgnoreCase( "hash" ) ) 582 return double_set_old_hash; 583 584 if( s.equalsIgnoreCase( "bit" ) ) 585 return double_set_old_bit; 586 587 if( s.equalsIgnoreCase( "hybrid" ) ) 588 return double_set_old_hybrid; 589 590 if( s.equalsIgnoreCase( "array" ) ) 591 return double_set_old_array; 592 593 throw new RuntimeException ( "Invalid value "+s+" of phase option double-set-old" ); 594 } 595 596 public static final int double_set_new_hash = 1; 597 public static final int double_set_new_bit = 2; 598 public static final int double_set_new_hybrid = 3; 599 public static final int double_set_new_array = 4; 600 609 public int double_set_new() { 610 String s = soot.PhaseOptions.getString( options, "double-set-new" ); 611 612 if( s.equalsIgnoreCase( "hash" ) ) 613 return double_set_new_hash; 614 615 if( s.equalsIgnoreCase( "bit" ) ) 616 return double_set_new_bit; 617 618 if( s.equalsIgnoreCase( "hybrid" ) ) 619 return double_set_new_hybrid; 620 621 if( s.equalsIgnoreCase( "array" ) ) 622 return double_set_new_array; 623 624 throw new RuntimeException ( "Invalid value "+s+" of phase option double-set-new" ); 625 } 626 627 } 628 | Popular Tags |