From 712f3cbae6bfd3c6f6cc40d44f438aa0affcd371 Mon Sep 17 00:00:00 2001 From: xleroy Date: Tue, 18 Dec 2012 07:54:35 +0000 Subject: Support for inline assembly (asm statements). cparser: add primitive support for enum types. bitfield emulation: for bitfields with enum type, choose signed/unsigned as appropriate git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2074 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- common/AST.v | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'common/AST.v') diff --git a/common/AST.v b/common/AST.v index ccc9dbf2..40da732b 100644 --- a/common/AST.v +++ b/common/AST.v @@ -447,10 +447,16 @@ Inductive external_function : Type := (** A programmer-supplied annotation. Takes zero, one or several arguments, produces an event carrying the text and the values of these arguments, and returns no value. *) - | EF_annot_val (text:ident) (targ: typ). + | EF_annot_val (text: ident) (targ: typ) (** Another form of annotation that takes one argument, produces an event carrying the text and the value of this argument, and returns the value of the argument. *) + | EF_inline_asm (text: ident). + (** Inline [asm] statements. Semantically, treated like an + annotation with no parameters ([EF_annot text nil]). To be + used with caution, as it can invalidate the semantic + preservation theorem. Generated only if [-finline-asm] is + given. *) (** The type signature of an external function. *) @@ -467,6 +473,7 @@ Definition ef_sig (ef: external_function): signature := | EF_memcpy sz al => mksignature (Tint :: Tint :: nil) None | EF_annot text targs => mksignature targs None | EF_annot_val text targ => mksignature (targ :: nil) (Some targ) + | EF_inline_asm text => mksignature nil None end. (** Whether an external function should be inlined by the compiler. *) @@ -484,6 +491,7 @@ Definition ef_inline (ef: external_function) : bool := | EF_memcpy sz al => true | EF_annot text targs => true | EF_annot_val text targ => true + | EF_inline_asm text => true end. (** Whether an external function must reload its arguments. *) -- cgit