From 2a6dab836a978a9cb9d0ea2d9dbe08288db97ea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9onard=20G=C3=A9rard?= Date: Thu, 17 Nov 2011 15:22:28 +0100 Subject: [PATCH] Add alias to obc vd. --- compiler/obc/obc.ml | 1 + compiler/obc/obc_utils.ml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/compiler/obc/obc.ml b/compiler/obc/obc.ml index b84f519..528aa6c 100644 --- a/compiler/obc/obc.ml +++ b/compiler/obc/obc.ml @@ -89,6 +89,7 @@ and block = and var_dec = { v_ident : var_ident; v_type : ty; + v_alias : bool; (* this var_dec only declare a const pointer, no allocation is done *) v_linearity : linearity; v_mutable : bool; v_loc : location } diff --git a/compiler/obc/obc_utils.ml b/compiler/obc/obc_utils.ml index 9988f8b..178bd84 100644 --- a/compiler/obc/obc_utils.ml +++ b/compiler/obc/obc_utils.ml @@ -17,8 +17,9 @@ open Obc open Obc_mapfold open Global_mapfold -let mk_var_dec ?(loc=no_location) ?(linearity = Ltop) ?(mut=false) ident ty = - { v_ident = ident; v_type = ty; v_linearity = linearity; v_mutable = mut; v_loc = loc } +let mk_var_dec ?(loc=no_location) ?(linearity = Ltop) ?(mut=false) ?(alias=false) ident ty = + { v_ident = ident; v_type = ty; v_linearity = linearity; + v_alias = alias; v_mutable = mut; v_loc = loc } let mk_ext_value ?(loc=no_location) ty desc = { w_desc = desc; w_ty = ty; w_loc = loc; }