Revision 5fccce23 src/backends/C/c_backend_common.ml
src/backends/C/c_backend_common.ml | ||
---|---|---|
470 | 470 |
name |
471 | 471 |
(Utils.fprintf_list ~sep:",@ " pp_c_decl_input_var) inputs |
472 | 472 |
|
473 |
let print_import_init fmt (Dep (local, basename, _, _)) =
|
|
474 |
if local then |
|
475 |
let baseNAME = file_to_module_name basename in
|
|
473 |
let print_import_init fmt dep =
|
|
474 |
if dep.local then
|
|
475 |
let baseNAME = file_to_module_name dep.name in
|
|
476 | 476 |
fprintf fmt "%a();" pp_global_init_name baseNAME |
477 | 477 |
else () |
478 | 478 |
|
479 |
let print_import_clear fmt (Dep (local, basename, _, _)) =
|
|
480 |
if local then |
|
481 |
let baseNAME = file_to_module_name basename in
|
|
479 |
let print_import_clear fmt dep =
|
|
480 |
if dep.local then
|
|
481 |
let baseNAME = file_to_module_name dep.name in
|
|
482 | 482 |
fprintf fmt "%a();" pp_global_clear_name baseNAME |
483 | 483 |
else () |
484 | 484 |
|
485 |
let print_import_prototype fmt (Dep (_, s, _, _)) =
|
|
486 |
fprintf fmt "#include \"%s.h\"@," s
|
|
485 |
let print_import_prototype fmt dep =
|
|
486 |
fprintf fmt "#include \"%s.h\"@," dep.name
|
|
487 | 487 |
|
488 |
let print_import_alloc_prototype fmt (Dep (_, s, _, stateful)) =
|
|
489 |
if stateful then |
|
490 |
fprintf fmt "#include \"%s_alloc.h\"@," s
|
|
488 |
let print_import_alloc_prototype fmt dep =
|
|
489 |
if dep.is_stateful then
|
|
490 |
fprintf fmt "#include \"%s_alloc.h\"@," dep.name
|
|
491 | 491 |
|
492 |
let print_extern_alloc_prototypes fmt (Dep (_,_, header,_)) =
|
|
492 |
let print_extern_alloc_prototypes fmt dep =
|
|
493 | 493 |
List.iter (fun decl -> match decl.top_decl_desc with |
494 | 494 |
| ImportedNode ind when not ind.nodei_stateless -> |
495 | 495 |
let static = List.filter (fun v -> v.var_dec_const) ind.nodei_inputs in |
... | ... | |
498 | 498 |
fprintf fmt "extern %a;@.@." print_dealloc_prototype ind.nodei_id; |
499 | 499 |
end |
500 | 500 |
| _ -> () |
501 |
) header
|
|
501 |
) dep.content
|
|
502 | 502 |
|
503 | 503 |
|
504 | 504 |
let pp_c_main_var_input fmt id = |
Also available in: Unified diff