From 2570ddd61b1c98b62c8d97fce862654535696844 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 26 Feb 2012 10:41:07 +0000 Subject: - 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 --- cfrontend/PrintCsyntax.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cfrontend/PrintCsyntax.ml') diff --git a/cfrontend/PrintCsyntax.ml b/cfrontend/PrintCsyntax.ml index 804b018..0616049 100644 --- a/cfrontend/PrintCsyntax.ml +++ b/cfrontend/PrintCsyntax.ml @@ -145,6 +145,7 @@ let rec precedence = function | Eval _ -> (16, NA) | Evalof(l, _) -> precedence l | Esizeof _ -> (15, RtoL) + | Ealignof _ -> (15, RtoL) | Ecall _ -> (16, LtoR) | Epostincr _ -> (16, LtoR) | Eunop _ -> (15, RtoL) @@ -196,6 +197,8 @@ let rec expr p (prec, e) = fprintf p "" | Esizeof(ty, _) -> fprintf p "sizeof(%s)" (name_type ty) + | Ealignof(ty, _) -> + fprintf p "__alignof__(%s)" (name_type ty) | Eunop(op, a1, _) -> fprintf p "%s%a" (name_unop op) expr (prec', a1) | Eaddrof(a1, _) -> @@ -444,7 +447,8 @@ let rec collect_expr = function | Ecast(r, _) -> collect_expr r | Econdition(r1, r2, r3, _) -> collect_expr r1; collect_expr r2; collect_expr r3 - | Esizeof _ -> () + | Esizeof(ty, _) -> collect_type ty + | Ealignof(ty, _) -> collect_type ty | Eassign(l, r, _) -> collect_expr l; collect_expr r | Eassignop(_, l, r, _, _) -> collect_expr l; collect_expr r | Epostincr(_, l, _) -> collect_expr l -- cgit v1.2.3