From 76555ffd2403b3ebf1ea353063c16763e6493722 Mon Sep 17 00:00:00 2001 From: xleroy Date: Mon, 6 May 2013 11:32:22 +0000 Subject: Refactoring: move definition of chunk_of_type to AST.v. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2238 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- common/AST.v | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'common') diff --git a/common/AST.v b/common/AST.v index fb80b46..fba5354 100644 --- a/common/AST.v +++ b/common/AST.v @@ -115,6 +115,16 @@ Definition type_of_chunk (c: memory_chunk) : typ := | Mfloat64al32 => Tfloat end. +(** The chunk that is appropriate to store and reload a value of + the given type, without losing information. *) + +Definition chunk_of_type (ty: typ) := + match ty with + | Tint => Mint32 + | Tfloat => Mfloat64al32 + | Tlong => Mint64 + end. + (** Initialization data for global variables. *) Inductive init_data: Type := -- cgit v1.2.3