Project

General

Profile

Revision 76c7023b

View differences:

src/corelang.ml
504 504
 List.find (fun v -> v.var_id = id) var_list
505 505

  
506 506
let get_node_var id node =
507
  get_var id (get_node_vars node)
508

  
507
  try
508
    get_var id (get_node_vars node)
509
  with Not_found -> begin
510
    Format.eprintf "Unable to find variable %s in node %s@.@?" id node.node_id;
511
    raise Not_found
512
  end
513
    
509 514
let get_node_eqs =
510 515
  let get_eqs stmts =
511 516
    List.fold_right
......
1030 1035
let copy_prog top_list =
1031 1036
  List.map copy_top top_list
1032 1037

  
1038
let functional_backend () = 
1039
  match !Options.output with
1040
  | "horn" | "lustre" | "acsl" -> true
1041
  | _ -> false
1042

  
1033 1043
(* Local Variables: *)
1034 1044
(* compile-command:"make -C .." *)
1035 1045
(* End: *)
src/corelang.mli
140 140
val update_expr_annot: ident -> expr -> expr_annot -> expr
141 141
(* val mkpredef_call: Location.t -> ident -> eexpr list -> eexpr*)
142 142

  
143
val functional_backend: unit -> bool
143 144
(* Local Variables: *)
144 145
(* compile-command:"make -C .." *)
145 146
(* End: *)
src/main_lustre_compiler.ml
88 88
  end
89 89

  
90 90

  
91
let functional_backend () = 
92
  match !Options.output with
93
  | "horn" | "lustre" | "acsl" -> true
94
  | _ -> false
95 91

  
96 92
(* From prog to prog *)
97 93
let stage1 prog dirname basename =
......
296 292
  in  
297 293
  (* Optimize machine code *)
298 294
  let machine_code =  (* TODO reactivate. I disabled it because output variables were removed *)
299
    if false && !Options.optimization >= 3 && not (functional_backend ()) then
295
    if false && !Options.optimization >= 3 && not (Corelang.functional_backend ()) then
300 296
      begin
301 297
	Log.report ~level:1 (fun fmt -> fprintf fmt ".. machines optimization: minimize heap alloc by reusing vars@,");
302 298
	let node_schs    = Scheduling.remove_prog_inlined_locals removed_table node_schs in

Also available in: Unified diff