Project

General

Profile

Revision ad4774b0 src/compiler_stages.ml

View differences:

src/compiler_stages.ml
3 3
open Compiler_common
4 4
open LustreSpec
5 5

  
6
exception StopPhase1 of program
6
exception StopPhase1 of program_t
7 7

  
8 8
let dynamic_checks () =
9 9
  match !Options.output, !Options.spec with
......
22 22
      begin
23 23
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %s@," header_name);
24 24
	Lusic.write_lusic false (Lusic.extract_header dirname basename prog) destname lusic_ext;
25
	Lusic.print_lusic_to_h destname lusic_ext
25
	if !Options.output = "C" then Lusic.print_lusic_to_h destname lusic_ext
26 26
      end
27 27
    else
28 28
      let lusic = Lusic.read_lusic destname lusic_ext in
......
31 31
	  Log.report ~level:1 (fun fmt -> fprintf fmt ".. generating compiled header file %s@," header_name);
32 32
       	  Lusic.write_lusic false (Lusic.extract_header dirname basename prog) destname lusic_ext;
33 33
	  (*List.iter (fun top_decl -> Format.eprintf "lusic: %a@." Printers.pp_decl top_decl) lusic.Lusic.contents;*)
34
	  Lusic.print_lusic_to_h destname lusic_ext
34
	  if !Options.output = "C" then Lusic.print_lusic_to_h destname lusic_ext
35 35
	end
36 36
      else
37 37
	begin
......
47 47

  
48 48

  
49 49
(* From prog to prog *)
50
let stage1 prog dirname basename =
50
let stage1 params prog dirname basename =
51 51
  (* Updating parent node information for variables *)
52 52
  Compiler_common.update_vdecl_parents_prog prog;
53 53

  
......
175 175

  
176 176
  (* Normalization phase *)
177 177
  Log.report ~level:1 (fun fmt -> fprintf fmt ".. normalization@,");
178
  let prog = Normalization.normalize_prog ~backend:!Options.output prog in
178
  let prog = Normalization.normalize_prog params prog in
179 179
  Log.report ~level:2 (fun fmt -> fprintf fmt "@[<v 2>@ %a@]@," Printers.pp_prog prog);
180 180

  
181 181
  let prog =

Also available in: Unified diff