summaryrefslogtreecommitdiff
path: root/src/spec_analysis.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/spec_analysis.ml')
-rw-r--r--src/spec_analysis.ml16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/spec_analysis.ml b/src/spec_analysis.ml
index 19f7b085..371acfdc 100644
--- a/src/spec_analysis.ml
+++ b/src/spec_analysis.ml
@@ -217,7 +217,7 @@ let rec fv_of_exp consider_var bound used set (E_aux (e,(_,tannot))) : (Nameset.
| E_let(lebind,e) ->
let b,u,s = fv_of_let consider_var bound used set lebind in
fv_of_exp consider_var b u s e
- | E_internal_let (lexp, exp1, exp2) ->
+ | E_var (lexp, exp1, exp2) ->
let b,u,s = fv_of_lexp consider_var bound used set lexp in
let _,used,set = fv_of_exp consider_var bound used set exp1 in
fv_of_exp consider_var b used set exp2
@@ -242,13 +242,13 @@ and fv_of_pes consider_var bound used set pes =
let bound_g,us_g,set_g = fv_of_exp consider_var bound_p us_p set g in
let bound_e,us_e,set_e = fv_of_exp consider_var bound_g us_g set_g e in
fv_of_pes consider_var bound us_e set_e pes
-
+
and fv_of_let consider_var bound used set (LB_aux(lebind,_)) = match lebind with
| LB_val(pat,exp) ->
let bound_p, us_p = pat_bindings consider_var bound used pat in
let _,us_e,set_e = fv_of_exp consider_var bound used set exp in
bound_p,Nameset.union us_p us_e,set_e
-
+
and fv_of_lexp consider_var bound used set (LEXP_aux(lexp,(_,tannot))) =
match lexp with
| LEXP_id id ->
@@ -257,6 +257,8 @@ and fv_of_lexp consider_var bound used set (LEXP_aux(lexp,(_,tannot))) =
if Nameset.mem i bound
then bound, used, Nameset.add i set
else Nameset.add i bound, Nameset.add i used, set
+ | LEXP_deref exp ->
+ fv_of_exp consider_var bound used set exp
| LEXP_cast(typ,id) ->
let used = Nameset.union (free_type_names_tannot consider_var tannot) used in
let i = string_of_id id in
@@ -307,8 +309,8 @@ let fv_of_type_def consider_var (TD_aux(t,_)) = match t with
typ_variants consider_var bindings tunions
| TD_enum(id,_,ids,_) ->
Nameset.of_list (List.map string_of_id (id::ids)),mt
- | TD_register(id,n1,n2,_) ->
- init_env (string_of_id id), fv_of_nexp consider_var mt (fv_of_nexp consider_var mt mt n1) n2
+ | TD_bitfield(id,typ,_) ->
+ init_env (string_of_id id), Nameset.empty (* fv_of_typ consider_var mt typ *)
let fv_of_tannot_opt consider_var (Typ_annot_opt_aux (t,_)) =
match t with
@@ -458,6 +460,10 @@ let fv_of_def consider_var consider_scatter_as_one all_defs = function
init_env (string_of_id id),
List.fold_left (fun ns id -> Nameset.add ("val:" ^ string_of_id id) ns) mt ids
| DEF_default def -> mt,mt
+ | DEF_internal_mutrec fdefs ->
+ let fvs = List.map (fv_of_fun consider_var) fdefs in
+ List.fold_left Nameset.union Nameset.empty (List.map fst fvs),
+ List.fold_left Nameset.union Nameset.empty (List.map snd fvs)
| DEF_scattered sdef -> fv_of_scattered consider_var consider_scatter_as_one all_defs sdef
| DEF_reg_dec rdec -> fv_of_rd consider_var rdec
| DEF_comm _ -> mt,mt