From ccab6f7aad96361969e13dfd86b06cb9b5646c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwena=EBl=20Delaval?= Date: Tue, 31 Jul 2012 16:54:01 +0200 Subject: [PATCH] Normalization of record consts Normalization of records as constant to ease the compilation: f({ x = e }) -> v = { x = e }; f(v) --- compiler/heptagon/transformations/normalize.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/heptagon/transformations/normalize.ml b/compiler/heptagon/transformations/normalize.ml index 35f81be..f182a83 100644 --- a/compiler/heptagon/transformations/normalize.ml +++ b/compiler/heptagon/transformations/normalize.ml @@ -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