diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2017-02-06 16:53:12 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2017-02-06 16:53:12 +0100 |
commit | 8ace28abf0c70ebdc423baea9ae0e8c68e0b60ed (patch) | |
tree | 43e89a45ed321081cbcaaac06165a7e62b84a34b /cparser/Cutil.mli | |
parent | 9d4bb7ec914566b3920cca3c6823515448fb65c1 (diff) | |
parent | 4afaf8c23274752c8a6067bd785e114578068702 (diff) | |
download | compcert-kvx-8ace28abf0c70ebdc423baea9ae0e8c68e0b60ed.tar.gz compcert-kvx-8ace28abf0c70ebdc423baea9ae0e8c68e0b60ed.zip |
Merge branch 'elaboration-of-attributes'
Diffstat (limited to 'cparser/Cutil.mli')
-rw-r--r-- | cparser/Cutil.mli | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli index 5e560e44..4eaa9e4a 100644 --- a/cparser/Cutil.mli +++ b/cparser/Cutil.mli @@ -52,15 +52,32 @@ 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 attr_is_type_related: attribute -> bool - (* Is an attribute type-related (true) or variable-related (false)? *) + +type attribute_class = + | Attr_name (* Attribute applies to the names being declared *) + | Attr_type (* Attribute applies to types *) + | Attr_struct (* Attribute applies to struct, union and enum *) + | Attr_function (* Attribute applies to function types and decls *) + | Attr_unknown (* Not a declared attribute *) + +val declare_attribute: string -> attribute_class -> unit +val declare_attributes: (string * attribute_class) list -> unit + (* Register the given custom attribute names with the given classes. *) +val class_of_attribute: attribute -> attribute_class + (* Return the class of the given attribute. Standard attributes + have class [Attr_type]. Custom attributes have the class that + was given to them using [declare_attribute], or [Attr_unknown] + if not declared. *) val attr_inherited_by_members: attribute -> bool (* Is an attribute of a composite inherited by members of the composite? *) + + val strip_attributes_type: typ -> attribute list -> typ (* Remove all attributes from the given type that are not contained in the list *) val strip_last_attribute: typ -> attribute option * typ (* Remove the last top level attribute and return it *) + (* Type compatibility *) type attr_handling = |