Project

General

Profile

Download (1.41 KB) Statistics
| Branch: | Tag: | Revision:
1 2b476ad8 xthirioux
open LustreSpec
2
3 1954d776 ploc
open PluginList
4 2b476ad8 xthirioux
5 f6acf47b ploc
let options () = 
6
  List.flatten (
7
    List.map Options.plugin_opt (
8
      List.map (fun m ->
9
	let module M = (val m : PluginType.PluginType) in
10
	(M.name, M.activate, M.options)
11
      ) plugins
12
    ))
13 2b476ad8 xthirioux
14 f6acf47b ploc
let check_force_stateful () =
15
  List.exists (fun m ->
16
	let module M = (val m : PluginType.PluginType) in
17
	M.check_force_stateful ()
18
  ) plugins
19
20
let refine_machine_code prog machine_code =
21
  List.fold_left (fun accu m ->
22
    let module M = (val m : PluginType.PluginType) in
23
    M.refine_machine_code prog accu
24
  ) machine_code plugins
25
26
27
let c_backend_main_loop_body_suffix fmt () = 
28
  List.iter (fun (m: (module PluginType.PluginType)) -> 
29
    let module M = (val m : PluginType.PluginType) in
30
    M.c_backend_main_loop_body_suffix fmt ()) plugins
31
32
(* Specific treatment of annotations when inlining, specific of declared plugins *)
33 2b476ad8 xthirioux
34
let inline_annots rename_var_fun annot_list =
35
  List.map (
36
    fun ann -> 
37
      { ann with 
38
	annots = List.fold_left (
39
	  fun accu (sl, eexpr) -> 
40
	    let items = 
41
	      match sl with 
42
	      | plugin_name::args -> 
43
		if plugin_name = "salsa" then
44
		  match args with
45
		  | ["ranges";varname] -> 
46
		    [["salsa";"ranges";(rename_var_fun varname)], eexpr]
47
		  | _ -> [(sl, eexpr)]
48
		else
49
		  [(sl, eexpr)]
50
	    | _ -> assert false
51
	    in
52
	    items@accu
53
	) [] ann.annots
54
      }
55
  ) annot_list
56
57
(* Local Variables: *)
58
(* compile-command:"make -C .." *)
59
(* End: *)