From bc8046564b345281024d5f40f59d012ba92cdb4b Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 21 Aug 2018 19:06:45 +0200 Subject: Add check for _Alignas attribute. The check tests whether the standard _Alignas is contained within a given attribute list. Bug 23391 --- cparser/Cutil.ml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cparser/Cutil.ml') 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 = -- cgit