22
33open Prelude
44open GobConfig
5- open Defaults
65open Printf
76open Goblintutil
87
@@ -83,10 +82,10 @@ let option_spec_list =
8382 set_bool " dbg.print_dead_code" true ;
8483 set_string " result" " sarif"
8584 in
86- let defaults_spec_list = List. map (fun ( _ , ( name , ( _ , _ ))) ->
85+ let defaults_spec_list = List. map (fun path ->
8786 (* allow "--option value" as shorthand for "--set option value" *)
88- (" --" ^ name , Arg. String (set_auto name ), " " )
89- ) ! Defaults. registrar
87+ (" --" ^ path , Arg. String (set_auto path ), " " )
88+ ) Options. paths
9089 in
9190 let tmp_arg = ref " " in
9291 [ " -o" , Arg. String (set_string " outfile" ), " "
@@ -100,8 +99,8 @@ let option_spec_list =
10099 ; " --conf" , Arg. String merge_file, " "
101100 ; " --writeconf" , Arg. String (fun fn -> writeconffile := fn), " "
102101 ; " --version" , Arg. Unit print_version, " "
103- ; " --print_options" , Arg. Unit (fun _ -> printCategory stdout Std ; exit 0 ), " "
104- ; " --print_all_options" , Arg. Unit (fun _ -> printAllCategories stdout ; exit 0 ), " "
102+ ; " --print_options" , Arg. Unit (fun () -> Options. print_options () ; exit 0 ), " "
103+ ; " --print_all_options" , Arg. Unit (fun () -> Options. print_all_options () ; exit 0 ), " "
105104 ; " --trace" , Arg. String set_trace, " "
106105 ; " --tracevars" , add_string Tracing. tracevars, " "
107106 ; " --tracelocs" , add_int Tracing. tracelocs, " "
@@ -362,13 +361,12 @@ let do_analyze change_info merged_AST =
362361 Printexc. raise_with_backtrace e backtrace (* re-raise with captured inner backtrace *)
363362 (* Cilfacade.current_file := ast'; *)
364363 in
365- (* old style is ana.activated = [phase_1, ...] with phase_i = [ana_1, ...]
366- new style (Goblintutil.phase_config = true) is phases[i].ana.activated = [ana_1, ...]
364+ (* new style is phases[i].ana.activated = [ana_1, ...]
367365 phases[i].ana.x overwrites setting ana.x *)
368366 let num_phases =
369367 let np,na,nt = Tuple3. mapn (List. length % get_list) (" phases" , " ana.activated" , " trans.activated" ) in
370- phase_config := np > 0 ; (* TODO what about wrong usage like { phases = [...], ana.activated = [...] }? should child-lists add to parent-lists? *)
371- if get_bool " dbg.verbose" then print_endline @@ " Using " ^ if ! phase_config then " new" else " old " ^ " format for phases!" ;
368+ (* TODO what about wrong usage like { phases = [...], ana.activated = [...] }? should child-lists add to parent-lists? *)
369+ if get_bool " dbg.verbose" then print_endline @@ " Using new format for phases!" ;
372370 if np = 0 && na = 0 && nt = 0 then failwith " No phases and no activated analyses or transformations!" ;
373371 max np 1
374372 in
0 commit comments