aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cutil.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2018-08-21 19:06:45 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-08-24 09:26:50 +0200
commitbc8046564b345281024d5f40f59d012ba92cdb4b (patch)
tree56fe7a5b2ac82fdfb4ed63fdba6447f15782b29d /cparser/Cutil.ml
parent7f6bd2f39e66cb0704b526d0450845cd0234e0c9 (diff)
downloadcompcert-kvx-bc8046564b345281024d5f40f59d012ba92cdb4b.tar.gz
compcert-kvx-bc8046564b345281024d5f40f59d012ba92cdb4b.zip
Add check for _Alignas attribute.
The check tests whether the standard _Alignas is contained within a given attribute list. Bug 23391
Diffstat (limited to 'cparser/Cutil.ml')
-rw-r--r--cparser/Cutil.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml
index 4b69c95e..a0a2cf56 100644
--- a/cparser/Cutil.ml
+++ b/cparser/Cutil.ml
@@ -257,6 +257,10 @@ let strip_last_attribute typ =
| TEnum (n,at) -> let l,r = hd_opt at in
l,TEnum(n,r)
+(* Check whether the attributes contain _Alignas attribute *)
+let has_std_alignas attr =
+ List.exists (function | AAlignas _ -> true | _ -> false) attr
+
(* Extracting alignment value from a set of attributes. Return 0 if none. *)
let alignas_attribute al =