Frama-C API - Ast_attributes
This file contains attribute related types/functions/values.
Attributes lists/values
Name of the attribute that is automatically inserted (with an AINT size
argument when querying the type of a field that is a bitfield.
Name of the attribute that is inserted when generating a name for a varinfo representing an anonymous function parameter.
val anonymous_attribute : Cil_types.attribute
Attribute identifying anonymous function parameters.
Qualifiers and internal attributes to remove when doing a C cast.
Qualifiers and internal attributes to remove when doing a C cast.
Qualifiers and internal attributes to remove when doing a C cast.
A varinfo marked with this attribute is known to be a ghost formal.
A formal marked with this attribute is known to be a pointer to an object being initialized by the current function, which can thus assign any sub-object regardless of const status.
A field struct marked with this attribute is known to be mutable, i.e. it can be modified even on a const object.
A block marked with this attribute is known to be inlined, i.e. it replaces a call to an inline function.
Attributes manipulations
val get_name : Cil_types.attribute -> string
Return the name of an attribute.
val add : Cil_types.attribute -> Cil_types.attributes -> Cil_types.attributes
Add an attribute. Maintains the attributes in sorted order of the second argument. The attribute is not added if it is already there.
val add_list : Cil_types.attributes -> Cil_types.attributes -> Cil_types.attributes
Add a list of attributes. Maintains the attributes in sorted order. The second argument must be sorted, but not necessarily the first.
val drop : string -> Cil_types.attributes -> Cil_types.attributes
Remove all attributes with the given name. Maintains the attributes in sorted order.
val drop_list : string list -> Cil_types.attributes -> Cil_types.attributes
Remove all attributes with names appearing in the string list. Maintains the attributes in sorted order.
val replace_params : string -> Cil_types.attrparam list -> Cil_types.attributes -> Cil_types.attributes
val contains : string -> Cil_types.attributes -> bool
True if the named attribute appears in the attribute list. The list of attributes must be sorted.
val find_params : string -> Cil_types.attributes -> Cil_types.attrparam list
Return the list of parameters associated to an attribute. The list is empty if there is no such attribute or it has no parameters at all.
val filter : string -> Cil_types.attributes -> Cil_types.attributes
Retain attributes with the given name.
Attributes classes and registration
val known_table : (string, attribute_class) Stdlib.Hashtbl.t
Table containing all registered attributes.
val register : attribute_class -> string -> unit
Add a new attribute with a specified class
val register_list : attribute_class -> string list -> unit
Register a list of attributes with a given class.
val get_class : default:attribute_class -> string -> attribute_class
Return the class of an attribute. The class `default' is returned for unknown and ignored attributes.
is_known_attribute attrname
returns true if the attribute named attrname
is known by Frama-C.
val partition : default:attribute_class -> Cil_types.attributes -> Cil_types.attributes * Cil_types.attributes * Cil_types.attributes
Partition the attributes into classes: name attributes, function type and type attributes. Unknown and ignored attributes are returned in the `default` attribute class.
Utility functions
val filter_qualifiers : Cil_types.attributes -> Cil_types.attributes
Retain attributes corresponding to type qualifiers (6.7.3)
val split_array_attributes : Cil_types.attributes -> Cil_types.attributes * Cil_types.attributes
Given some attributes on an array type, split them into those that belong to the type of the elements of the array (currently, qualifiers such as const and volatile), and those that must remain on the array, in that order.
val split_storage_modifiers : Cil_types.attributes -> Cil_types.attributes * Cil_types.attributes
Separate out the storage-modifier name attributes