Project

General

Profile

Download (1.41 KB) Statistics
| Branch: | Tag: | Revision:
1
open LustreSpec
2

    
3
open PluginList
4

    
5

    
6
let options () = 
7
  List.flatten (
8
    List.map Options.plugin_opt (
9
      List.map (fun m ->
10
	let module M = (val m : PluginType.PluginType) in
11
	(M.name, M.activate, M.options)
12
      ) plugins
13
    ))
14

    
15
let check_force_stateful () =
16
  List.exists (fun m ->
17
	let module M = (val m : PluginType.PluginType) in
18
	M.check_force_stateful ()
19
  ) plugins
20

    
21
let refine_machine_code prog machine_code =
22
  List.fold_left (fun accu m ->
23
    let module M = (val m : PluginType.PluginType) in
24
    M.refine_machine_code prog accu
25
  ) machine_code plugins
26

    
27

    
28
let c_backend_main_loop_body_suffix fmt () = 
29
  List.iter (fun (m: (module PluginType.PluginType)) -> 
30
    let module M = (val m : PluginType.PluginType) in
31
    M.c_backend_main_loop_body_suffix fmt ()) plugins
32

    
33
(* Specific treatment of annotations when inlining, specific of declared plugins *)
34

    
35
let inline_annots rename_var_fun annot_list =
36
  List.map (
37
    fun ann -> 
38
      { ann with 
39
	annots = List.fold_left (
40
	  fun accu (sl, eexpr) -> 
41
	    let items = 
42
	      match sl with 
43
	      | plugin_name::args -> 
44
		if plugin_name = "salsa" then
45
		  match args with
46
		  | ["ranges";varname] -> 
47
		    [["salsa";"ranges";(rename_var_fun varname)], eexpr]
48
		  | _ -> [(sl, eexpr)]
49
		else
50
		  [(sl, eexpr)]
51
	    | _ -> assert false
52
	    in
53
	    items@accu
54
	) [] ann.annots
55
      }
56
  ) annot_list
57

    
58
(* Local Variables: *)
59
(* compile-command:"make -C .." *)
60
(* End: *)
(50-50/60)