Project

General

Profile

Revision 66359a5e src/corelang.ml

View differences:

src/corelang.ml
41 41
let mkclock loc d =
42 42
  { ck_dec_desc = d; ck_dec_loc = loc }
43 43

  
44
let mkvar_decl loc ?(orig=false) (id, ty_dec, ck_dec, is_const, value) =
44
let mkvar_decl loc ?(orig=false) (id, ty_dec, ck_dec, is_const, value, parentid) =
45 45
  assert (value = None || is_const);
46 46
  { var_id = id;
47 47
    var_orig = orig;
......
49 49
    var_dec_clock = ck_dec;
50 50
    var_dec_const = is_const;
51 51
    var_dec_value = value;
52
    var_parent_nodeid = parentid;
52 53
    var_type = Types.new_var ();
53 54
    var_clock = Clocks.new_var true;
54 55
    var_loc = loc }
......
62 63
    expr_annot = None;
63 64
    expr_loc = loc }
64 65

  
65
let var_decl_of_const c =
66
let var_decl_of_const ?(parentid=None) c =
66 67
  { var_id = c.const_id;
67 68
    var_orig = true;
68 69
    var_dec_type = { ty_dec_loc = c.const_loc; ty_dec_desc = Tydec_any };
69 70
    var_dec_clock = { ck_dec_loc = c.const_loc; ck_dec_desc = Ckdec_any };
70 71
    var_dec_const = true;
71 72
    var_dec_value = None;
73
    var_parent_nodeid = parentid;
72 74
    var_type = c.const_type;
73 75
    var_clock = Clocks.new_var false;
74 76
    var_loc = c.const_loc }
......
626 628
  nodei_outputs = nd.node_outputs;
627 629
  nodei_stateless = nd.node_dec_stateless;
628 630
  nodei_spec = nd.node_spec;
631
  (* nodei_annot = nd.node_annot; *)
629 632
  nodei_prototype = None;
630 633
  nodei_in_lib = [];
631 634
 }
......
901 904
  List.map
902 905
    (fun _ -> incr cpt;
903 906
              let name = sprintf "_var_%d" !cpt in
904
              mkvar_decl loc (name, mktyp loc Tydec_any, mkclock loc Ckdec_any, false, None))
907
              mkvar_decl loc (name, mktyp loc Tydec_any, mkclock loc Ckdec_any, false, None, None))
905 908
    (Types.type_list_of_type ty)
906 909

  
907 910
let mk_internal_node id =
......
920 923
	nodei_outputs = vdecls_of_typ_ck cpt tout;
921 924
	nodei_stateless = Types.get_static_value ty <> None;
922 925
	nodei_spec = spec;
926
	(* nodei_annot = []; *)
923 927
	nodei_prototype = None;
924 928
       	nodei_in_lib = [];
925 929
       })
......
1104 1108

  
1105 1109

  
1106 1110
let copy_var_decl vdecl =
1107
  mkvar_decl vdecl.var_loc ~orig:vdecl.var_orig (vdecl.var_id, vdecl.var_dec_type, vdecl.var_dec_clock, vdecl.var_dec_const, vdecl.var_dec_value)
1111
  mkvar_decl vdecl.var_loc ~orig:vdecl.var_orig (vdecl.var_id, vdecl.var_dec_type, vdecl.var_dec_clock, vdecl.var_dec_const, vdecl.var_dec_value, vdecl.var_parent_nodeid)
1108 1112

  
1109 1113
let copy_const cdecl =
1110 1114
  { cdecl with const_type = Types.new_var () }

Also available in: Unified diff