summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-06 11:32:22 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-06 11:32:22 +0000
commit76555ffd2403b3ebf1ea353063c16763e6493722 (patch)
tree16b044dd521b32f4f8f3b759f15b811196679274 /common
parent52808842306243ed922eb8e7cf0525f1d890198c (diff)
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
Diffstat (limited to 'common')
-rw-r--r--common/AST.v10
1 files changed, 10 insertions, 0 deletions
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 :=