Project

General

Profile

Revision 7065d912 src/corelang.ml

View differences:

src/corelang.ml
1173 1173

  
1174 1174

  
1175 1175

  
1176
(* Generate a new local [node] variable *)
1177
let cpt_fresh = ref 0
1178

  
1179
let reset_cpt_fresh () =
1180
    cpt_fresh := 0
1181
    
1182
let mk_fresh_var node loc ty ck =
1183
  let vars = get_node_vars node in
1184
  let rec aux () =
1185
  incr cpt_fresh;
1186
  let s = Printf.sprintf "__%s_%d" node.node_id !cpt_fresh in
1187
  if List.exists (fun v -> v.var_id = s) vars then aux () else
1188
  {
1189
    var_id = s;
1190
    var_orig = false;
1191
    var_dec_type = dummy_type_dec;
1192
    var_dec_clock = dummy_clock_dec;
1193
    var_dec_const = false;
1194
    var_dec_value = None;
1195
    var_parent_nodeid = Some node.node_id;
1196
    var_type = ty;
1197
    var_clock = ck;
1198
    var_loc = loc
1199
  }
1200
  in aux ()
1176 1201

  
1177 1202
(* Local Variables: *)
1178 1203
(* compile-command:"make -C .." *)

Also available in: Unified diff