Project

General

Profile

« Previous | Next » 

Revision f69e7ea2

Added by LĂ©lio Brun about 2 years ago

add -O -1 flag to disable fusion of conditionals

View differences:

src/backends/backends.ml
2 2
let join_guards = ref true
3 3

  
4 4
let setup () =
5
  match !Options.output with
6
  | "emf" ->
7
     (* Not merging branches *)
8
     join_guards := false;
9
     (* In case of a default "int" type, substitute it with the legal int32 value *)
10
     if !Options.int_type = "int" then
11
       Options.int_type := "int32"
12
  | _ -> ()
5
  if !Options.output = "emf" then begin
6
    (* Not merging branches *)
7
    join_guards := false;
8
    (* In case of a default "int" type, substitute it with the legal int32 value *)
9
    if !Options.int_type = "int" then Options.int_type := "int32"
10
  end;
11
  if !Options.optimization < 0 then
12
    join_guards := false
13 13

  
14 14
let is_functional () = 
15 15
  match !Options.output with
src/main_lustre_compiler.ml
57 57
  let params = Backends.get_normalization_params () in
58 58

  
59 59
  let prog, dependencies = 
60
    Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2>.. Phase 1 : Normalisation@,");
60
    Log.report ~level:1 (fun fmt -> fprintf fmt "@[<v 2>.. Phase 1: Normalisation@,");
61 61
    try 
62 62
      Compiler_stages.stage1 params prog dirname basename extension
63 63
    with Compiler_stages.StopPhase1 prog -> (
......
124 124
      else
125 125
	ok, ext)
126 126
    (false, "") extensions in
127
  if ok_ext then
127
  if ok_ext then begin
128
    Options_management.setup();
128 129
    let dirname = Filename.dirname filename in
129 130
    let basename = Filename.chop_suffix (Filename.basename filename) ext in
130 131
    compile dirname basename ext
131
  else
132
  end else
132 133
    raise (Arg.Bad ("Can only compile *.lusi, *.lus or *.ec files"))
133 134

  
134 135
let _ =
src/options.ml
65 65

  
66 66
(* Printer options *)
67 67
let kind2_print = ref false
68
                    
69
                  
68

  
70 69
(* Local Variables: *)
71 70
(* compile-command:"make -C .." *)
72 71
(* End: *)
src/options_management.ml
88 88
    )
89 89
  | _ -> real_type := s
90 90

  
91
let set_backend s =
92
  output := s;
91
let setup () =
93 92
  Backends.setup ()
94 93

  
94
let set_backend s =
95
  output := s
96

  
95 97
let common_options =
96 98
  [ "-d", Arg.Set_string dest_dir, "uses the specified \x1b[4mdirectory\x1b[0m as root for generated/imported object and C files <default: .>";
97 99
    "-I", Arg.String add_include_dir, "sets include \x1b[4mdirectory\x1b[0m";

Also available in: Unified diff