Revision a7062da6
Added by LĂ©lio Brun over 3 years ago
src/backends/C/c_backend_main.ml | ||
---|---|---|
16 | 16 |
open C_backend_common |
17 | 17 |
open Utils |
18 | 18 |
|
19 |
module Mpfr = Lustrec_mpfr |
|
20 |
|
|
19 | 21 |
module type MODIFIERS_MAINSRC = sig end |
20 | 22 |
|
21 | 23 |
module EmptyMod = struct end |
... | ... | |
37 | 39 |
|
38 | 40 |
let print_put_output fmt id o' o = |
39 | 41 |
let suff = string_of_int (id + 1) in |
40 |
print_put_var fmt suff o'.var_id o.var_type o.var_id
|
|
42 |
pp_put_var fmt suff o'.var_id o.var_type o.var_id
|
|
41 | 43 |
|
42 | 44 |
let print_main_inout_declaration fmt m = |
43 | 45 |
fprintf fmt |
... | ... | |
133 | 135 |
outputs |
134 | 136 |
|
135 | 137 |
let print_get_input fmt id v' v = |
136 |
let pp_file = pp_print_file ("in" ^ string_of_int (id + 1)) in
|
|
138 |
let pp_file = pp_file ("in" ^ string_of_int (id + 1)) in |
|
137 | 139 |
let unclocked_t = Types.unclock_type v.var_type in |
138 | 140 |
fprintf fmt "@[<v>%a@]" |
139 | 141 |
(fun fmt () -> |
... | ... | |
156 | 158 |
pp_file ("f", v.var_id) |
157 | 159 |
else ( |
158 | 160 |
Global.main_node := !Options.main_node; |
159 |
eprintf "Code generation error: %a%a@." Error.pp_error_msg
|
|
160 |
Error.Main_wrong_kind Location.pp_loc v'.var_loc;
|
|
161 |
eprintf "Code generation error: %a%a@." Error.pp |
|
162 |
Error.Main_wrong_kind Location.pp v'.var_loc; |
|
161 | 163 |
raise (Error.Error (v'.var_loc, Error.Main_wrong_kind)))) |
162 | 164 |
() |
163 | 165 |
|
... | ... | |
318 | 320 |
@,\ |
319 | 321 |
%a@,\ |
320 | 322 |
%a\n\ |
321 |
\ @]@." print_main_header () print_import_alloc_prototype
|
|
323 |
\ @]@." print_main_header () pp_import_alloc_prototype
|
|
322 | 324 |
{ |
323 | 325 |
local = true; |
324 | 326 |
name = basename; |
Also available in: Unified diff
another step towards refactoring