diff options
Diffstat (limited to 'cparser')
-rw-r--r-- | cparser/Cutil.ml | 4 | ||||
-rw-r--r-- | cparser/Cutil.mli | 2 |
2 files changed, 6 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 = diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli index 491551a4..56b09e1d 100644 --- a/cparser/Cutil.mli +++ b/cparser/Cutil.mli @@ -57,6 +57,8 @@ val erase_attributes_type : Env.t -> typ -> typ (* Erase the attributes of the given type. *) val change_attributes_type : Env.t -> (attributes -> attributes) -> typ -> typ (* Apply the given function to the top-level attributes of the given type *) +val has_std_alignas : attributes -> bool + (* Do the attributes contain the C11 _Alignas *) type attribute_class = | Attr_name (* Attribute applies to the names being declared *) |