From 033aa0555a209fa3e825b1eeb8a5fc00ff8163e3 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 1 Nov 2009 09:55:35 +0000 Subject: Support Clight initializers of the form "int * x = &y;". git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1162 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- common/AST.v | 1 + common/Mem.v | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'common') diff --git a/common/AST.v b/common/AST.v index e7b85a9..13e84dd 100644 --- a/common/AST.v +++ b/common/AST.v @@ -91,6 +91,7 @@ Inductive init_data: Type := | Init_float32: float -> init_data | Init_float64: float -> init_data | Init_space: Z -> init_data + | Init_addrof: ident -> int -> init_data (**r address of symbol + offset *) | Init_pointer: list init_data -> init_data. (** Whole programs consist of: diff --git a/common/Mem.v b/common/Mem.v index 01c1975..6510828 100644 --- a/common/Mem.v +++ b/common/Mem.v @@ -568,6 +568,9 @@ Fixpoint contents_init_data (pos: Z) (id: list init_data) {struct id}: contentma setN 7%nat pos (Vfloat f) (contents_init_data (pos + 1) id') | Init_space n :: id' => contents_init_data (pos + Zmax n 0) id' + | Init_addrof s n :: id' => + (* Not handled properly yet *) + contents_init_data (pos + 4) id' | Init_pointer x :: id' => (* Not handled properly yet *) contents_init_data (pos + 4) id' @@ -581,6 +584,7 @@ Definition size_init_data (id: init_data) : Z := | Init_float32 _ => 4 | Init_float64 _ => 8 | Init_space n => Zmax n 0 + | Init_addrof _ _ => 4 | Init_pointer _ => 4 end. -- cgit v1.2.3