diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-26 10:41:07 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-26 10:41:07 +0000 |
commit | 2570ddd61b1c98b62c8d97fce862654535696844 (patch) | |
tree | e9a652b115045a3b2c4ade69ec3cc3fdad429b54 /cparser/Cprint.ml | |
parent | 65cc3738e7436e46f70c0508638a71fbb49c50a8 (diff) |
- Support for _Alignof(ty) operator from ISO C 2011
and __alignof__(ty), __alignof__(expr) from GCC.
- Resurrected __builtin_memcpy_aligned, useful for files generated
by Scade KCG 6.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1827 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Cprint.ml')
-rw-r--r-- | cparser/Cprint.ml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cparser/Cprint.ml b/cparser/Cprint.ml index 5887e87..2924c3d 100644 --- a/cparser/Cprint.ml +++ b/cparser/Cprint.ml @@ -181,6 +181,7 @@ type associativity = LtoR | RtoL | NA let precedence = function (* H&S section 7.2 *) | EConst _ -> (16, NA) | ESizeof _ -> (15, RtoL) + | EAlignof _ -> (15, RtoL) | EVar _ -> (16, NA) | EBinop(Oindex, _, _, _) -> (16, LtoR) | ECall _ -> (16, LtoR) @@ -215,6 +216,7 @@ let rec exp pp (prec, a) = | EConst cst -> const pp cst | EVar id -> ident pp id | ESizeof ty -> fprintf pp "sizeof(%a)" typ ty + | EAlignof ty -> fprintf pp "__alignof(%a)" typ ty | EUnop(Ominus, a1) -> fprintf pp "-%a" exp (prec', a1) | EUnop(Oplus, a1) -> |