From f124bb4fd7f94fbef760db6635ab16984676be31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Fri, 23 Jul 2010 19:45:19 +0200 Subject: [PATCH] Refactoring Ident -> Idents ( uniform with Names etc ) --- compiler/global/{ident.ml => idents.ml} | 0 compiler/global/{ident.mli => idents.mli} | 0 compiler/heptagon/analysis/causal.ml | 4 +--- compiler/heptagon/analysis/causality.ml | 2 +- compiler/heptagon/analysis/initialization.ml | 2 +- compiler/heptagon/analysis/interface.ml | 8 +++---- compiler/heptagon/analysis/typing.ml | 2 +- compiler/heptagon/hept_printer.ml | 2 +- compiler/heptagon/heptagon.ml | 2 +- compiler/heptagon/parsing/hept_scoping.ml | 2 +- compiler/heptagon/transformations/automata.ml | 12 +++++----- .../transformations/automata_mapfold.ml | 12 +++++----- .../heptagon/transformations/completion.ml | 2 +- .../transformations/completion_mapfold.ml | 2 +- .../transformations/completion_mapfold2.ml | 2 +- compiler/heptagon/transformations/every.ml | 2 +- compiler/heptagon/transformations/inline.ml | 4 ++-- compiler/heptagon/transformations/last.ml | 4 ++-- .../heptagon/transformations/last_mapfold.ml | 4 ++-- compiler/heptagon/transformations/reset.ml | 9 +++---- .../heptagon/transformations/reset_mapfold.ml | 8 +++---- compiler/main/hept2mls.ml | 8 +++---- compiler/main/mls2obc.ml | 12 +++++----- compiler/minils/analysis/clocking.ml | 11 +++++---- compiler/minils/analysis/init.ml | 2 +- compiler/minils/minils.ml | 2 +- compiler/minils/mls_printer.ml | 2 +- compiler/minils/mls_utils.ml | 2 +- compiler/minils/parsing/mls_parser.mly | 2 +- compiler/minils/transformations/callgraph.ml | 2 +- .../transformations/callgraph_mapfold.ml | 2 +- compiler/minils/transformations/itfusion.ml | 4 ++-- compiler/minils/transformations/normalize.ml | 4 ++-- compiler/obc/c/cgen.ml | 2 +- compiler/obc/c/cmain.ml | 24 ++++++++++--------- compiler/obc/c/csubst.ml | 2 +- compiler/obc/control.ml | 3 +-- compiler/obc/java/java.ml | 4 ++-- compiler/obc/obc.ml | 2 +- compiler/obc/obc_printer.ml | 2 +- compiler/utilities/global/dep.ml | 2 +- 41 files changed, 90 insertions(+), 89 deletions(-) rename compiler/global/{ident.ml => idents.ml} (100%) rename compiler/global/{ident.mli => idents.mli} (100%) diff --git a/compiler/global/ident.ml b/compiler/global/idents.ml similarity index 100% rename from compiler/global/ident.ml rename to compiler/global/idents.ml diff --git a/compiler/global/ident.mli b/compiler/global/idents.mli similarity index 100% rename from compiler/global/ident.mli rename to compiler/global/idents.mli diff --git a/compiler/heptagon/analysis/causal.ml b/compiler/heptagon/analysis/causal.ml index bae3fc8..ecd552a 100644 --- a/compiler/heptagon/analysis/causal.ml +++ b/compiler/heptagon/analysis/causal.ml @@ -9,11 +9,9 @@ (* causality check of scheduling constraints *) -(* $Id: causal.ml 615 2009-11-20 17:43:14Z pouzet $ *) - open Misc open Names -open Ident +open Idents open Heptagon open Location open Graph diff --git a/compiler/heptagon/analysis/causality.ml b/compiler/heptagon/analysis/causality.ml index 6e83018..515215a 100644 --- a/compiler/heptagon/analysis/causality.ml +++ b/compiler/heptagon/analysis/causality.ml @@ -13,7 +13,7 @@ open Misc open Names -open Ident +open Idents open Heptagon open Location open Graph diff --git a/compiler/heptagon/analysis/initialization.ml b/compiler/heptagon/analysis/initialization.ml index 6740842..7240ce5 100644 --- a/compiler/heptagon/analysis/initialization.ml +++ b/compiler/heptagon/analysis/initialization.ml @@ -14,7 +14,7 @@ open Misc open Names -open Ident +open Idents open Heptagon open Types open Location diff --git a/compiler/heptagon/analysis/interface.ml b/compiler/heptagon/analysis/interface.ml index d492035..e9367a2 100644 --- a/compiler/heptagon/analysis/interface.ml +++ b/compiler/heptagon/analysis/interface.ml @@ -8,7 +8,7 @@ (**************************************************************************) (* Read an interface *) -open Ident +open Idents open Names open Heptagon open Signature @@ -110,7 +110,7 @@ struct let print oc = let ff = formatter_of_out_channel oc in - NamesEnv.iter (fun key typdesc -> deftype ff key typdesc) current.types; - NamesEnv.iter (fun key constdec -> constdef ff key constdec) current.consts; - NamesEnv.iter (fun key sigtype -> signature ff key sigtype) current.values; + NamesEnv.iter (fun key typdesc -> deftype ff key typdesc) current.types; + NamesEnv.iter (fun key constdec -> constdef ff key constdec) current.consts; + NamesEnv.iter (fun key sigtype -> signature ff key sigtype) current.values; end diff --git a/compiler/heptagon/analysis/typing.ml b/compiler/heptagon/analysis/typing.ml index f5e3059..365541e 100644 --- a/compiler/heptagon/analysis/typing.ml +++ b/compiler/heptagon/analysis/typing.ml @@ -12,7 +12,7 @@ open Misc open Names -open Ident +open Idents open Location open Signature open Modules diff --git a/compiler/heptagon/hept_printer.ml b/compiler/heptagon/hept_printer.ml index 5083074..1ebac7e 100644 --- a/compiler/heptagon/hept_printer.ml +++ b/compiler/heptagon/hept_printer.ml @@ -11,7 +11,7 @@ open Location open Misc open Names -open Ident +open Idents open Modules open Static open Format diff --git a/compiler/heptagon/heptagon.ml b/compiler/heptagon/heptagon.ml index 85bf781..eb2e79d 100644 --- a/compiler/heptagon/heptagon.ml +++ b/compiler/heptagon/heptagon.ml @@ -10,7 +10,7 @@ open Location open Misc open Names -open Ident +open Idents open Static open Signature open Types diff --git a/compiler/heptagon/parsing/hept_scoping.ml b/compiler/heptagon/parsing/hept_scoping.ml index 28772f4..e70efed 100644 --- a/compiler/heptagon/parsing/hept_scoping.ml +++ b/compiler/heptagon/parsing/hept_scoping.ml @@ -5,7 +5,7 @@ open Location open Types open Hept_parsetree open Names -open Ident +open Idents open Format open Printf open Static diff --git a/compiler/heptagon/transformations/automata.ml b/compiler/heptagon/transformations/automata.ml index a74a40c..af0ddc5 100644 --- a/compiler/heptagon/transformations/automata.ml +++ b/compiler/heptagon/transformations/automata.ml @@ -12,7 +12,7 @@ open Misc open Names -open Ident +open Idents open Heptagon open Types @@ -100,11 +100,11 @@ and translate_automaton v eq_list handlers = let tstatetype = Tid statetype in let initial = Name(NamesEnv.find (List.hd handlers).s_state states) in - let statename = Ident.fresh "s" in - let next_statename = Ident.fresh "ns" in - let resetname = Ident.fresh "r" in - let next_resetname = Ident.fresh "nr" in - let pre_next_resetname = Ident.fresh "pnr" in + let statename = Idents.fresh "s" in + let next_statename = Idents.fresh "ns" in + let resetname = Idents.fresh "r" in + let next_resetname = Idents.fresh "nr" in + let pre_next_resetname = Idents.fresh "pnr" in let name n = Name(NamesEnv.find n states) in let state n = mk_exp (Econst (mk_static_exp diff --git a/compiler/heptagon/transformations/automata_mapfold.ml b/compiler/heptagon/transformations/automata_mapfold.ml index 90d942e..fb6c641 100644 --- a/compiler/heptagon/transformations/automata_mapfold.ml +++ b/compiler/heptagon/transformations/automata_mapfold.ml @@ -11,7 +11,7 @@ open Misc open Types open Names -open Ident +open Idents open Heptagon open Hept_mapfold @@ -64,11 +64,11 @@ let translate_automaton v eq_list handlers = let tstatetype = Tid statetype in let initial = Name(NamesEnv.find (List.hd handlers).s_state states) in - let statename = Ident.fresh "s" in - let next_statename = Ident.fresh "ns" in - let resetname = Ident.fresh "r" in - let next_resetname = Ident.fresh "nr" in - let pre_next_resetname = Ident.fresh "pnr" in + let statename = Idents.fresh "s" in + let next_statename = Idents.fresh "ns" in + let resetname = Idents.fresh "r" in + let next_resetname = Idents.fresh "nr" in + let pre_next_resetname = Idents.fresh "pnr" in let name n = Name(NamesEnv.find n states) in let state n = mk_exp (Econst (mk_static_exp diff --git a/compiler/heptagon/transformations/completion.ml b/compiler/heptagon/transformations/completion.ml index 57220b3..74c4336 100644 --- a/compiler/heptagon/transformations/completion.ml +++ b/compiler/heptagon/transformations/completion.ml @@ -10,7 +10,7 @@ open Misc open Heptagon -open Ident +open Idents (* adds an equation [x = last(x)] for every partially defined variable *) (* in a control structure *) diff --git a/compiler/heptagon/transformations/completion_mapfold.ml b/compiler/heptagon/transformations/completion_mapfold.ml index 9c79611..fbacfaa 100644 --- a/compiler/heptagon/transformations/completion_mapfold.ml +++ b/compiler/heptagon/transformations/completion_mapfold.ml @@ -12,7 +12,7 @@ open Misc open Heptagon open Global_mapfold open Hept_mapfold -open Ident +open Idents (* adds an equation [x = last(x)] for every partially defined variable *) (* in a control structure *) diff --git a/compiler/heptagon/transformations/completion_mapfold2.ml b/compiler/heptagon/transformations/completion_mapfold2.ml index 69f28e0..6dd2f0b 100644 --- a/compiler/heptagon/transformations/completion_mapfold2.ml +++ b/compiler/heptagon/transformations/completion_mapfold2.ml @@ -12,7 +12,7 @@ open Misc open Heptagon open Global_mapfold open Hept_mapfold -open Ident +open Idents (* We first define a shallow pass, diff --git a/compiler/heptagon/transformations/every.ml b/compiler/heptagon/transformations/every.ml index b4e93a9..b3401d3 100644 --- a/compiler/heptagon/transformations/every.ml +++ b/compiler/heptagon/transformations/every.ml @@ -16,7 +16,7 @@ *) open Misc -open Ident +open Idents open Heptagon open Reset diff --git a/compiler/heptagon/transformations/inline.ml b/compiler/heptagon/transformations/inline.ml index 3502821..24a4797 100644 --- a/compiler/heptagon/transformations/inline.ml +++ b/compiler/heptagon/transformations/inline.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Misc -open Ident +open Idents open Signature open Types open Names @@ -19,7 +19,7 @@ let to_be_inlined s = !Misc.flatten || (List.mem s !Misc.inline) let mk_unique_node nd = let mk_bind vd = - let id = Ident.fresh (Ident.sourcename vd.v_ident) in + let id = Idents.fresh (Idents.sourcename vd.v_ident) in (vd.v_ident, { vd with v_ident = id; }) in let subst = List.map mk_bind (nd.n_block.b_local @ nd.n_input @ nd.n_output) in diff --git a/compiler/heptagon/transformations/last.ml b/compiler/heptagon/transformations/last.ml index 63fbfb2..baad46a 100644 --- a/compiler/heptagon/transformations/last.ml +++ b/compiler/heptagon/transformations/last.ml @@ -10,7 +10,7 @@ open Misc open Heptagon -open Ident +open Idents (* introduce a fresh equation [last_x = pre(x)] for every *) (* variable declared with a last *) @@ -18,7 +18,7 @@ let last (eq_list, env, v) { v_ident = n; v_type = t; v_last = last } = match last with | Var -> (eq_list, env, v) | Last(default) -> - let lastn = Ident.fresh ("last" ^ (sourcename n)) in + let lastn = Idents.fresh ("last" ^ (sourcename n)) in let eq = mk_equation (Eeq (Evarpat lastn, mk_exp (Epre (default, mk_exp (Evar n) t)) t)) in diff --git a/compiler/heptagon/transformations/last_mapfold.ml b/compiler/heptagon/transformations/last_mapfold.ml index 3e57cd0..f330a44 100644 --- a/compiler/heptagon/transformations/last_mapfold.ml +++ b/compiler/heptagon/transformations/last_mapfold.ml @@ -9,7 +9,7 @@ (* removing accessed to shared variables (last x) *) open Heptagon open Hept_mapfold -open Ident +open Idents (* introduce a fresh equation [last_x = pre(x)] for every *) (* variable declared with a last *) @@ -17,7 +17,7 @@ let last (eq_list, env, v) { v_ident = n; v_type = t; v_last = last } = match last with | Var -> (eq_list, env, v) | Last(default) -> - let lastn = Ident.fresh ("last" ^ (sourcename n)) in + let lastn = Idents.fresh ("last" ^ (sourcename n)) in let eq = mk_equation (Eeq (Evarpat lastn, mk_exp (Epre (default, mk_exp (Evar n) t)) t)) in diff --git a/compiler/heptagon/transformations/reset.ml b/compiler/heptagon/transformations/reset.ml index e21d8b2..cf06102 100644 --- a/compiler/heptagon/transformations/reset.ml +++ b/compiler/heptagon/transformations/reset.ml @@ -10,7 +10,7 @@ open Misc -open Ident +open Idents open Heptagon open Types @@ -88,7 +88,7 @@ let ifres res e2 e3 = (* add an equation *) let equation v acc_eq_list e = - let n = Ident.fresh "r" in + let n = Idents.fresh "r" in n, (mk_bool_param n) :: v, (mk_equation (Eeq(Evarpat n, e))) ::acc_eq_list @@ -170,7 +170,7 @@ and translate_eqs res v acc_eq_list eq_list = and translate_switch res locals acc_eq_list switch_handlers = (* introduce a reset bit for each branch *) - let tab_of_vars n = Array.init n (fun _ -> Ident.fresh "r") in + let tab_of_vars n = Array.init n (fun _ -> Idents.fresh "r") in let n = List.length switch_handlers in let m = tab_of_vars n in let lm = tab_of_vars n in @@ -239,7 +239,8 @@ and translate res e = | Eiterator(it, ({ a_op = Enode _ } as op), n, e_list, None) -> let e_list = List.map (translate res) e_list in if true_reset res then - { e with e_desc = Eiterator(it, op, n, e_list, Some (exp_of_res res)) } + { e + with e_desc = Eiterator(it, op, n, e_list, Some (exp_of_res res)) } else { e with e_desc = Eiterator(it, op, n, e_list, None) } | Eiterator(it, op, n, e_list, r) -> diff --git a/compiler/heptagon/transformations/reset_mapfold.ml b/compiler/heptagon/transformations/reset_mapfold.ml index 6b9aaf5..0f05765 100644 --- a/compiler/heptagon/transformations/reset_mapfold.ml +++ b/compiler/heptagon/transformations/reset_mapfold.ml @@ -10,7 +10,7 @@ open Misc -open Ident +open Idents open Heptagon open Hept_mapfold open Types @@ -75,7 +75,7 @@ let ifres res e2 e3 = (* add an equation *) let equation v acc_eq_list e = - let n = Ident.fresh "r" in + let n = Idents.fresh "r" in n, (mk_bool_param n) :: v, (mk_equation (Eeq(Evarpat n, e))) ::acc_eq_list @@ -135,8 +135,8 @@ let edesc funs (res, v, acc_eq_list) ed = let switch_handlers funs (res, v, acc_eq_list) switch_handlers = (* introduce a reset bit for each branch *) - let m_list = List.map (fun _ -> Ident.fresh "r") switch_handlers in - let lm_list = List.map (fun _ -> Ident.fresh "r") switch_handlers in + let m_list = List.map (fun _ -> Idents.fresh "r") switch_handlers in + let lm_list = List.map (fun _ -> Idents.fresh "r") switch_handlers in let body i ({ w_block = b } as sh) m lm = let defnames = List.fold_left (fun acc m -> diff --git a/compiler/main/hept2mls.ml b/compiler/main/hept2mls.ml index ad6c09f..2e80156 100644 --- a/compiler/main/hept2mls.ml +++ b/compiler/main/hept2mls.ml @@ -12,7 +12,7 @@ open Location open Misc open Names -open Ident +open Idents open Static open Types open Format @@ -90,7 +90,7 @@ end (* add an equation *) let equation locals l_eqs e = - let n = Ident.fresh "ck" in + let n = Idents.fresh "ck" in n, (mk_var_dec n e.e_ty) :: locals, (mk_equation (Evarpat n) e):: l_eqs @@ -252,7 +252,7 @@ let rec translate_pat = function let rec rename_pat ni locals s_eqs = function | Heptagon.Evarpat(n), ty -> if IdentSet.mem n ni then ( - let n_copy = Ident.fresh (sourcename n) in + let n_copy = Idents.fresh (sourcename n) in Evarpat n_copy, (mk_var_dec n_copy ty) :: locals, add n (mk_exp ~exp_ty:ty (Evar n_copy)) s_eqs @@ -323,7 +323,7 @@ and translate_switch_handlers env ni (locals, l_eqs, s_eqs) e handlers = [] -> IdentSet.empty | { Heptagon.w_block = { Heptagon.b_defnames = env } } :: _ -> (* Create set from env *) - (Ident.Env.fold + (Idents.Env.fold (fun name _ set -> IdentSet.add name set) env IdentSet.empty) in diff --git a/compiler/main/mls2obc.ml b/compiler/main/mls2obc.ml index 71110fc..1329e0e 100644 --- a/compiler/main/mls2obc.ml +++ b/compiler/main/mls2obc.ml @@ -10,7 +10,7 @@ (* Translation from Minils to Obc. *) open Misc open Names -open Ident +open Idents open Signature open Obc open Types @@ -189,7 +189,7 @@ let rec translate_eq map call_context { Minils.eq_lhs = pat; Minils.eq_rhs = e } | Minils.Evarpat x, Minils.Eapp ({ Minils.a_op = Minils.Eselect_slice; Minils.a_params = [idx1; idx2] }, [e], _) -> - let cpt = Ident.fresh "i" in + let cpt = Idents.fresh "i" in let e = translate map (si, j, s) e in let idx = mk_exp (Eop (op_from_string "+", [mk_evar cpt; @@ -236,7 +236,7 @@ let rec translate_eq map call_context { Minils.eq_lhs = pat; Minils.eq_rhs = e } | Minils.Evarpat x, Minils.Eapp ({ Minils.a_op = Minils.Earray_fill; Minils.a_params = [n] }, [e], _) -> - let cpt = Ident.fresh "i" in + let cpt = Idents.fresh "i" in let action = Afor (cpt, mk_static_exp (Sint 0), n, mk_block [Aassgn (mk_lhs (Larray (var_from_name map x, @@ -247,8 +247,8 @@ let rec translate_eq map call_context { Minils.eq_lhs = pat; Minils.eq_rhs = e } | Minils.Evarpat x, Minils.Eapp ({ Minils.a_op = Minils.Econcat }, [e1; e2], _) -> - let cpt1 = Ident.fresh "i" in - let cpt2 = Ident.fresh "i" in + let cpt1 = Idents.fresh "i" in + let cpt2 = Idents.fresh "i" in let x = var_from_name map x in (match e1.Minils.e_ty, e2.Minils.e_ty with | Tarray (_, n1), Tarray (_, n2) -> @@ -288,7 +288,7 @@ let rec translate_eq map call_context { Minils.eq_lhs = pat; Minils.eq_rhs = e } let name_list = translate_pat map pat in let c_list = List.map (translate map (si, j, s)) e_list in - let x = Ident.fresh "i" in + let x = Idents.fresh "i" in let call_context = Oarray ("n", mk_lhs (Lvar x)), Some n in let si', j', action = translate_iterator map call_context it name_list app loc n x c_list in diff --git a/compiler/minils/analysis/clocking.ml b/compiler/minils/analysis/clocking.ml index 3ccb9da..6b2431f 100644 --- a/compiler/minils/analysis/clocking.ml +++ b/compiler/minils/analysis/clocking.ml @@ -9,7 +9,7 @@ (* clock checking *) open Misc -open Ident +open Idents open Minils open Mls_printer open Signature @@ -39,10 +39,11 @@ let gen_index () = (incr index; !index) let new_var () = Cvar { contents = Cindex (gen_index ()); } -let rec repr ck = - match ck with - | Cbase | Con _ | Cvar { contents = Cindex _ } -> ck - | Cvar (({ contents = Clink ck } as link)) -> + +(** return the canonic representant form of a [ck] *) +let rec repr ck = match ck with + | Cbase | Con _ | Cvar { contents = Cindex _ } -> ck + | Cvar (({ contents = Clink ck } as link)) -> let ck = repr ck in (link.contents <- Clink ck; ck) let rec occur_check index ck = diff --git a/compiler/minils/analysis/init.ml b/compiler/minils/analysis/init.ml index deecd2f..ba24028 100644 --- a/compiler/minils/analysis/init.ml +++ b/compiler/minils/analysis/init.ml @@ -16,7 +16,7 @@ open Misc open Names -open Ident +open Idents open Minils open Location open Format diff --git a/compiler/minils/minils.ml b/compiler/minils/minils.ml index 0b6d118..8909006 100644 --- a/compiler/minils/minils.ml +++ b/compiler/minils/minils.ml @@ -11,7 +11,7 @@ open Location open Names -open Ident +open Idents open Signature open Static open Types diff --git a/compiler/minils/mls_printer.ml b/compiler/minils/mls_printer.ml index 1e47200..1fb7994 100644 --- a/compiler/minils/mls_printer.ml +++ b/compiler/minils/mls_printer.ml @@ -1,6 +1,6 @@ open Names -open Ident +open Idents open Types open Static open Format diff --git a/compiler/minils/mls_utils.ml b/compiler/minils/mls_utils.ml index ca98cef..724d6db 100644 --- a/compiler/minils/mls_utils.ml +++ b/compiler/minils/mls_utils.ml @@ -3,7 +3,7 @@ open Mls_mapfold open Mls_printer open Location open Names -open Ident +open Idents open Signature open Static open Types diff --git a/compiler/minils/parsing/mls_parser.mly b/compiler/minils/parsing/mls_parser.mly index cd66629..e53d385 100644 --- a/compiler/minils/parsing/mls_parser.mly +++ b/compiler/minils/parsing/mls_parser.mly @@ -2,7 +2,7 @@ open Signature open Names -open Ident +open Idents open Types open Location open Minils diff --git a/compiler/minils/transformations/callgraph.ml b/compiler/minils/transformations/callgraph.ml index 12bcadf..6568e83 100644 --- a/compiler/minils/transformations/callgraph.ml +++ b/compiler/minils/transformations/callgraph.ml @@ -1,7 +1,7 @@ open Misc open Minils open Names -open Ident +open Idents open Format open Location open Printf diff --git a/compiler/minils/transformations/callgraph_mapfold.ml b/compiler/minils/transformations/callgraph_mapfold.ml index fb5dba9..b9b82a6 100644 --- a/compiler/minils/transformations/callgraph_mapfold.ml +++ b/compiler/minils/transformations/callgraph_mapfold.ml @@ -161,7 +161,7 @@ let generate_new_name ln params = | Modname { qual = q; id = id } -> let new_ln = Modname { qual = q; - id = id ^ (Ident.name (Ident.fresh "")) } in + id = id ^ (Idents.name (Idents.fresh "")) } in Hashtbl.add info.nodes_names (ln, params) new_ln | _ -> assert false) diff --git a/compiler/minils/transformations/itfusion.ml b/compiler/minils/transformations/itfusion.ml index ac173d8..3bc4942 100644 --- a/compiler/minils/transformations/itfusion.ml +++ b/compiler/minils/transformations/itfusion.ml @@ -23,7 +23,7 @@ let tuple_of_vd_list l = let vd_of_arg ad = let n = match ad.a_name with None -> "_v" | Some n -> n in - mk_var_dec (Ident.fresh n) ad.a_type + mk_var_dec (Idents.fresh n) ad.a_type (** @return the lists of inputs and outputs (as var_dec) of an app object. *) @@ -74,7 +74,7 @@ let edesc funs acc ed = let new_inp, e, acc_eq_list = mk_call g acc_eq_list in new_inp @ inp, acc_eq_list, e::largs, local_args @ args, true | _ -> - let vd = mk_var_dec (Ident.fresh "_x") e.e_ty in + let vd = mk_var_dec (Idents.fresh "_x") e.e_ty in let x = mk_exp (Evar vd.v_ident) in vd::inp, acc_eq_list, x::largs, e::args, b in diff --git a/compiler/minils/transformations/normalize.ml b/compiler/minils/transformations/normalize.ml index d06e366..515f67f 100644 --- a/compiler/minils/transformations/normalize.ml +++ b/compiler/minils/transformations/normalize.ml @@ -8,7 +8,7 @@ (**************************************************************************) open Misc open Names -open Ident +open Idents open Signature open Minils open Mls_utils @@ -19,7 +19,7 @@ and cfalse = Name "false" let equation (d_list, eq_list) e = let add_one_var ty d_list = - let n = Ident.fresh "_v" in + let n = Idents.fresh "_v" in let d_list = (mk_var_dec ~clock:e.e_ck n ty) :: d_list in n, d_list in diff --git a/compiler/obc/c/cgen.ml b/compiler/obc/c/cgen.ml index da849b5..59cdd45 100644 --- a/compiler/obc/c/cgen.ml +++ b/compiler/obc/c/cgen.ml @@ -11,7 +11,7 @@ open Format open List open Misc open Names -open Ident +open Idents open Obc open Types open Modules diff --git a/compiler/obc/c/cmain.ml b/compiler/obc/c/cmain.ml index 5ce1e8f..0563593 100644 --- a/compiler/obc/c/cmain.ml +++ b/compiler/obc/c/cmain.ml @@ -11,7 +11,7 @@ open Format open List open Misc open Names -open Ident +open Idents open Obc open Types open Modules @@ -25,8 +25,8 @@ open Compiler_utils (** {1 Main C function generation} *) (* Unique names for C variables handling step counts. *) -let step_counter = Ident.fresh "step_c" -and max_step = Ident.fresh "step_max" +let step_counter = Idents.fresh "step_c" +and max_step = Idents.fresh "step_max" let assert_node_res cd = let stepm = find_step_method cd in @@ -42,9 +42,11 @@ let assert_node_res cd = cd.cd_name; exit 1); let mem = - (name (Ident.fresh ("mem_for_" ^ cd.cd_name)), Cty_id (cd.cd_name ^ "_mem")) + (name (Idents.fresh ("mem_for_" ^ cd.cd_name)), + Cty_id (cd.cd_name ^ "_mem")) and out = - (name (Ident.fresh ("out_for_" ^ cd.cd_name)), Cty_id (cd.cd_name ^ "_out")) in + (name (Idents.fresh ("out_for_" ^ cd.cd_name)), + Cty_id (cd.cd_name ^ "_out")) in let reset_i = Cfun_call (cd.cd_name ^ "_reset", [Caddrof (Cvar (fst mem))]) in let step_i = @@ -55,7 +57,7 @@ let assert_node_res cd = return 1; } *) - let outn = Ident.name ((List.hd stepm.m_outputs).v_ident) in + let outn = Idents.name ((List.hd stepm.m_outputs).v_ident) in Csblock { var_decls = []; block_body = @@ -101,7 +103,7 @@ let main_def_of_class_def cd = (** Generates scanf statements. *) let rec read_lhs_of_ty lhs ty = match ty with | Tarray (ty, n) -> - let iter_var = Ident.name (Ident.fresh "i") in + let iter_var = Idents.name (Idents.fresh "i") in let lhs = Carray (lhs, Clhs (Cvar iter_var)) in let (reads, bufs) = read_lhs_of_ty lhs ty in ([Cfor (iter_var, 0, int_of_static_exp n, reads)], bufs) @@ -127,7 +129,7 @@ let main_def_of_class_def cd = match need_buf_for_ty ty with | None -> ([scan_exp], []) | Some tyn -> - let varn = Ident.name (Ident.fresh "buf") in + let varn = Idents.name (Idents.fresh "buf") in ([scan_exp; Csexpr (Cfun_call (tyn ^ "_of_string", [Clhs (Cvar varn)]))], @@ -137,14 +139,14 @@ let main_def_of_class_def cd = resulting values of enum types. *) let rec write_lhs_of_ty lhs ty = match ty with | Tarray (ty, n) -> - let iter_var = Ident.name (Ident.fresh "i") in + let iter_var = Idents.name (Idents.fresh "i") in let lhs = Carray (lhs, Clhs (Cvar iter_var)) in let (reads, bufs) = write_lhs_of_ty lhs ty in ([cprint_string "[ "; Cfor (iter_var, 0, int_of_static_exp n, reads); cprint_string "]"], bufs) | _ -> - let varn = Ident.name (Ident.fresh "buf") in + let varn = Idents.name (Idents.fresh "buf") in let format_s = format_for_type ty in let nbuf_opt = need_buf_for_ty ty in let ep = match nbuf_opt with @@ -162,7 +164,7 @@ let main_def_of_class_def cd = let stepm = find_step_method cd in let (scanf_calls, scanf_decls) = let read_lhs_of_ty_for_vd vd = - read_lhs_of_ty (Cvar (Ident.name vd.v_ident)) vd.v_type in + read_lhs_of_ty (Cvar (Idents.name vd.v_ident)) vd.v_type in split (map read_lhs_of_ty_for_vd stepm.m_inputs) in let (printf_calls, printf_decls) = diff --git a/compiler/obc/c/csubst.ml b/compiler/obc/c/csubst.ml index 1a6ed49..32d468e 100644 --- a/compiler/obc/c/csubst.ml +++ b/compiler/obc/c/csubst.ml @@ -1,5 +1,5 @@ open C -open Ident +open Idents open Names let rec subst_stm map stm = match stm with diff --git a/compiler/obc/control.ml b/compiler/obc/control.ml index e844df3..9527210 100644 --- a/compiler/obc/control.ml +++ b/compiler/obc/control.ml @@ -9,10 +9,9 @@ (* control optimisation *) -(* $Id$ *) open Minils -open Ident +open Idents open Misc open Obc diff --git a/compiler/obc/java/java.ml b/compiler/obc/java/java.ml index 2ff3bf0..717ceab 100644 --- a/compiler/obc/java/java.ml +++ b/compiler/obc/java/java.ml @@ -14,7 +14,7 @@ open Format open Obc open Misc open Names -open Ident +open Idents open Pp_tools let jname_of_name name = @@ -503,7 +503,7 @@ let print_step ff n s objs ts single = (List.map (fun vd -> vd.v_ident) s.out) ts single; fprintf ff "@ @ return "; if single - then fprintf ff "%s" (jname_of_name (Ident.name (List.hd s.out).v_ident)) + then fprintf ff "%s" (jname_of_name (Idents.name (List.hd s.out).v_ident)) else fprintf ff "step_ans"; fprintf ff ";@]@ }@ @]" diff --git a/compiler/obc/obc.ml b/compiler/obc/obc.ml index 18214da..25f9173 100644 --- a/compiler/obc/obc.ml +++ b/compiler/obc/obc.ml @@ -10,7 +10,7 @@ open Misc open Names -open Ident +open Idents open Types open Signature open Location diff --git a/compiler/obc/obc_printer.ml b/compiler/obc/obc_printer.ml index d34dd09..6bbd94f 100644 --- a/compiler/obc/obc_printer.ml +++ b/compiler/obc/obc_printer.ml @@ -2,7 +2,7 @@ open Obc open Format open Pp_tools open Types -open Ident +open Idents open Names let print_vd ff vd = diff --git a/compiler/utilities/global/dep.ml b/compiler/utilities/global/dep.ml index 3277534..268f963 100644 --- a/compiler/utilities/global/dep.ml +++ b/compiler/utilities/global/dep.ml @@ -9,7 +9,7 @@ (* dependences between equations *) open Graph -open Ident +open Idents module type READ = sig