Normalization of record consts

Normalization of records as constant to ease the compilation:

f({ x = e })
->
v = { x = e };
f(v)
master
Gwenal Delaval 12 years ago
parent ccc07cc7b9
commit ccab6f7aad

@ -137,8 +137,8 @@ type kind = ExtValue | Any
(** Creates an equation and add it to the context if necessary. *)
let add context expected_kind e =
let up = match e.e_desc, expected_kind with
(* static arrays should be normalized to simplify code generation *)
| Econst { se_desc = Sarray _ | Sarray_power _ }, ExtValue -> true
(* static arrays and records should be normalized to simplify code generation *)
| Econst { se_desc = Sarray _ | Sarray_power _ | Srecord _ }, ExtValue -> true
| (Evar _ | Eapp ({ a_op = Efield | Etuple | Ereinit }, _, _) | Ewhen _
| Econst _) , ExtValue -> false
| _ , ExtValue -> true

Loading…
Cancel
Save