diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-12-18 07:54:35 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-12-18 07:54:35 +0000 |
commit | 712f3cbae6bfd3c6f6cc40d44f438aa0affcd371 (patch) | |
tree | 913762a241b5f97b3ef4df086ba6adaeb2ff45c4 /common/AST.v | |
parent | c629161139899e43a2fe7c5af59ca926cdab370e (diff) | |
download | compcert-712f3cbae6bfd3c6f6cc40d44f438aa0affcd371.tar.gz compcert-712f3cbae6bfd3c6f6cc40d44f438aa0affcd371.zip |
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
Diffstat (limited to 'common/AST.v')
-rw-r--r-- | common/AST.v | 10 |
1 files changed, 9 insertions, 1 deletions
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. *) |