From 1cb4b1154be30994d7a4e48be7d3e8b47fa1cd8e Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Mon, 30 Jan 2012 17:48:47 +0100 Subject: [PATCH] Memory allocation: do not share enums (and thus clocks). --- compiler/minils/analysis/interference.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/compiler/minils/analysis/interference.ml b/compiler/minils/analysis/interference.ml index 026b511..0dccfc9 100644 --- a/compiler/minils/analysis/interference.ml +++ b/compiler/minils/analysis/interference.ml @@ -36,7 +36,7 @@ module TyEnv = end) (** @return whether [ty] corresponds to a record type. *) -let is_record_type ty = match ty with +let is_record_type ty = match Modules.unalias_type ty with | Tid n -> (match Modules.find_type n with | Tstruct _ -> true @@ -52,6 +52,13 @@ let is_array_or_struct ty = | _ -> false) | _ -> false +let is_enum ty = match Modules.unalias_type ty with + | Tid n -> + (match Modules.find_type n with + | Tenum _ -> true + | _ -> false) + | _ -> false + module InterfRead = struct exception Const_extvalue @@ -163,7 +170,7 @@ module World = struct Signature.field_assoc f fields let is_optimized_ty ty = - !Compiler_options.interf_all || is_array_or_struct ty + (!Compiler_options.interf_all && not (is_enum ty)) || is_array_or_struct ty let is_optimized iv = is_optimized_ty (ivar_type iv)