Relevant command-line options are now stored as qualnames.

This commit is contained in:
Adrien Guatto 2010-09-30 21:40:04 +02:00
parent 6bdca86253
commit a4c3d9e856
3 changed files with 12 additions and 10 deletions

View file

@ -64,6 +64,7 @@ let compile_impl modname filename =
with x -> close_all_files (); raise x
let read_qualname f = Arg.String (fun s -> f (Names.qualname_of_string s))
let main () =
try
@ -76,10 +77,10 @@ let main () =
"-where", Arg.Unit locate_stdlib, doc_locate_stdlib;
"-stdlib", Arg.String set_stdlib, doc_stdlib;
"-c", Arg.Set create_object_file, doc_object_file;
"-s", Arg.String set_simulation_node, doc_sim;
"-inline", Arg.String add_inlined_node, doc_inline;
"-s", read_qualname set_simulation_node, doc_sim;
"-inline", read_qualname add_inlined_node, doc_inline;
"-flatten", Arg.Set flatten, doc_flatten;
"-assert", Arg.String add_assert, doc_assert;
"-assert", read_qualname add_assert, doc_assert;
"-nopervasives", Arg.Unit set_no_pervasives, doc_no_pervasives;
"-target", Arg.String add_target_language, doc_target;
"-targetpath", Arg.String set_target_path, doc_target_path;

View file

@ -257,10 +257,10 @@ let mk_main name p =
match (!Compiler_options.simulation_node, !Compiler_options.assert_nodes) with
| (None, []) -> []
| (_, n_names) ->
let find_class n =
try List.find (fun cd -> cd.cd_name.name = n) p.p_defs
let find_class qn =
try List.find (fun cd -> cd.cd_name = qn) p.p_defs
with Not_found ->
Format.eprintf "Unknown node %s.\n" n;
Format.eprintf "Unknown node %a.\n" Global_printer.print_qualname qn;
exit 1 in
let a_classes = List.map find_class n_names in

View file

@ -8,6 +8,8 @@
(**************************************************************************)
(* Compiler options *)
open Names
(* version of the compiler *)
let version = "0.4"
let date = "DATE"
@ -48,11 +50,11 @@ let show_version () =
let verbose = ref false
let print_types = ref false
let assert_nodes:string list ref = ref []
let assert_nodes : qualname list ref = ref []
let add_assert nd = assert_nodes := nd :: !assert_nodes
let simulation = ref false
let simulation_node : string option ref = ref None
let simulation_node : qualname option ref = ref None
let set_simulation_node s =
simulation := true;
simulation_node := Some s
@ -75,12 +77,11 @@ let full_type_info = ref false
let init = ref true
let inline:string list ref = ref []
let inline : qualname list ref = ref []
let add_inlined_node s = inline := s :: !inline
let flatten = ref false
let nodes_to_inline : string list ref = ref []
let do_iterator_fusion = ref false