Normalization of record consts

Normalization of records as constant to ease the compilation:

f({ x = e })
->
v = { x = e };
f(v)
This commit is contained in:
Gwenal Delaval 2012-07-31 16:54:01 +02:00
parent ccc07cc7b9
commit ccab6f7aad

View file

@ -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