summaryrefslogtreecommitdiff
path: root/cfrontend/PrintCsyntax.ml
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-05 08:11:34 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-05 08:11:34 +0000
commita6c369cbd63996c1571ae601b7d92070f024b22c (patch)
treedc4f3f5a52ae4ea230f307ce5f442137f014b79b /cfrontend/PrintCsyntax.ml
parentb55147379939553eccd4289fd18e7f161619be4d (diff)
Merge of the "alignas" branch.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2342 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/PrintCsyntax.ml')
-rw-r--r--cfrontend/PrintCsyntax.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/cfrontend/PrintCsyntax.ml b/cfrontend/PrintCsyntax.ml
index 897a2ee..ec82869 100644
--- a/cfrontend/PrintCsyntax.ml
+++ b/cfrontend/PrintCsyntax.ml
@@ -78,7 +78,11 @@ let struct_unions = ref StructUnion.empty
(* Declarator (identifier + type) *)
let attributes a =
- if attr_volatile a then " volatile" else ""
+ let s1 = if a.attr_volatile then " volatile" else "" in
+ match a.attr_alignas with
+ | None -> s1
+ | Some l ->
+ sprintf " _Alignas(%Ld)%s" (Int64.shift_left 1L (N.to_int l)) s1
let name_optid id =
if id = "" then "" else " " ^ id