Project

General

Profile

Download (1.17 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
9
       value *)
10
    if !Options.int_type = "int" then Options.int_type := "int32");
11
  if !Options.optimization < 0 then join_guards := false
12

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

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

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

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

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

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