Project

General

Profile

Download (1.16 KB) Statistics
| Branch: | Tag: | Revision:
1
(* Backend-specific options *)
2
let join_guards = ref true
3

    
4
let setup () =
5
  if !Options.output = Options.OutEMF then (
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
  if !Options.optimization < 0 then join_guards := false
11

    
12
let is_functional () =
13
  let open Options in
14
  match !output with OutHorn | OutLustre | OutEMF -> true | _ -> false
15

    
16
(* Special treatment of arrows in lustre backend. We want to keep them *)
17
let unfold_arrow () =
18
  match !Options.output with Options.OutLustre -> false | _ -> true
19

    
20
(* Forcing ite normalization *)
21
let alias_ite () =
22
  match !Options.output with Options.OutEMF -> true | _ -> false
23

    
24
(* Forcing basic functions normalization *)
25
let alias_internal_fun () =
26
  match !Options.output with Options.OutEMF -> true | _ -> false
27

    
28
let get_normalization_params () =
29
  {
30
    Normalization.unfold_arrow_active = unfold_arrow ();
31
    force_alias_ite = alias_ite ();
32
    force_alias_internal_fun = alias_internal_fun ();
33
  }
34

    
35
(* Local Variables: *)
36
(* compile-command: "make -k -C .." *)
37
(* End: *)
(1-1/2)