- Timestamp:
- Mar 28, 2013, 5:28:48 PM (8 years ago)
- Location:
- driver
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
driver/acc.ml
r3015 r3020 56 56 match Extracted.Compiler.compile observe cl with 57 57 | OK o -> o 58 | Error m -> failwith (Error.errormsg m) 59 in 60 let labelled = output.Extracted.Compiler.c_labelled_clight in 61 let l_costmap = output.Extracted.Compiler.c_clight_cost_map in 62 let s_costmap = output.Extracted.Compiler.c_stack_cost in 63 let style = Cost_instrumented (l_costmap,s_costmap) in 64 let instrumented = ClightPrinter.print_program style labelled in 65 let filename = Filename.chop_extension filename ^ "-instrumented.c" in 66 let och = open_out filename in 67 output_string och instrumented; 68 close_out och 58 | Error m -> failwith (Error.errormsg m) in 59 if Options.annotation_requested () then 60 begin 61 let labelled = output.Extracted.Compiler.c_labelled_clight in 62 let l_costmap = output.Extracted.Compiler.c_clight_cost_map in 63 let s_costmap = output.Extracted.Compiler.c_stack_cost in 64 let style = Cost_instrumented (l_costmap,s_costmap) in 65 let instrumented = ClightPrinter.print_program style labelled in 66 let filename = Filename.chop_extension filename ^ "-instrumented.c" in 67 let och = open_out filename in 68 output_string och instrumented; 69 close_out och 70 end 69 71 ) (OptionsParsing.results ()) -
driver/options.ml
r3005 r3020 2 2 let extra_doc s = "", Arg.Unit ignore, s 3 3 4 (* 4 5 let web_mode = ref false 5 6 let is_web_mode () = !web_mode 6 7 let set_web_mode () = web_mode := true 8 *) 7 9 10 (* 8 11 let default_choice = "default" 9 12 let option_settings_step = "during option settings" 10 13 11 (*12 14 let language_from_string kind default s = 13 15 try … … 31 33 *) 32 34 35 (* 33 36 let input_files = ref [] 34 37 let add_input_file f = input_files := f :: !input_files 35 38 let input_files () = !input_files 39 *) 36 40 37 41 let output_files = ref None … … 43 47 let annotation_requested () = !annotation_flag 44 48 49 (* 45 50 let interpretation_flag = ref false 46 51 let request_interpretation = (:=) interpretation_flag 47 52 let interpretation_requested () = !interpretation_flag 53 *) 48 54 49 55 let interpretations_flag = ref false … … 51 57 let interpretations_requested () = !interpretations_flag 52 58 59 (* 53 60 let debug_flag = ref false 54 61 let set_debug = (:=) debug_flag 55 62 let is_debug_enabled () = !debug_flag 63 *) 56 64 65 (* 57 66 let asm_pretty_flag = ref false 58 67 let set_asm_pretty = (:=) asm_pretty_flag 59 68 let is_asm_pretty () = !asm_pretty_flag 69 *) 60 70 61 71 let lustre_flag = ref false … … 93 103 *) 94 104 105 (* 95 106 let dev_test = ref false 96 107 let set_dev_test = (:=) dev_test 97 108 let is_dev_test_enabled () = !dev_test 109 *) 98 110 99 111 let options = OptionsParsing.register [ … … 113 125 " Add cost annotations on the source code."; 114 126 127 (* 115 128 "-i", Arg.Set interpretation_flag, 116 129 " Interpret the compiled code."; 130 *) 117 131 118 132 "-is", Arg.Set interpretations_flag, 119 " Interpret all the compilation passes."; 133 " Outputs and interprets all the compilation passes,"; 134 extra_doc " showing the execution traces"; 120 135 136 (* 121 137 "-d", Arg.Set debug_flag, 122 138 " Debug mode."; … … 124 140 extra_doc " Combined with an interpret option, shows the trace"; 125 141 extra_doc " of execution states."; 142 *) 126 143 127 144 "-o", Arg.String set_output_files, 128 145 " Prefix of the output files."; 129 146 147 (* 130 148 "-asm-pretty", Arg.Set asm_pretty_flag, 131 149 " Output a pretty-printed assembly file."; 150 *) 132 151 133 152 "-lustre", Arg.Set lustre_flag, … … 163 182 *) 164 183 184 (* 165 185 "-dev", Arg.Set dev_test, 166 186 " Playground for developers."; 187 *) 167 188 ] -
driver/options.mli
r3005 r3020 11 11 *) 12 12 13 (* 13 14 (** {2 Interpretation request} *) 14 15 val request_interpretation : bool -> unit 15 16 val interpretation_requested : unit -> bool 17 *) 16 18 17 19 (** {2 Interpretation requests} *) … … 23 25 val annotation_requested : unit -> bool 24 26 27 (* 25 28 (** {2 Input files} *) 26 29 val add_input_file : string -> unit 27 30 val input_files : unit -> string list 31 *) 28 32 29 33 (** {2 Output files} *) … … 31 35 val get_output_files : unit -> string option 32 36 37 (* 33 38 (** {2 Verbose mode} *) 34 39 val is_debug_enabled : unit -> bool 40 *) 35 41 42 (* 36 43 (** {2 Assembly pretty print} *) 37 44 val set_asm_pretty : bool -> unit 38 45 val is_asm_pretty : unit -> bool 46 *) 39 47 40 48 (** {2 Lustre file} *) … … 71 79 *) 72 80 81 (* 73 82 (** {2 Developers' playground} *) 74 83 val is_dev_test_enabled : unit -> bool 84 *) 75 85 86 (* 76 87 (** {2 Web application} *) 77 88 val set_web_mode : unit -> unit 78 89 val is_web_mode : unit -> bool 90 *)
Note: See TracChangeset
for help on using the changeset viewer.