From 3babd253e1d194549294c282e1b0c60097b26b07 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 3 Feb 2017 14:12:32 +0100 Subject: Refactor the classification of attributes Introduce Cutil.class_of_attribute to return the class of the given attribute: one among Attr_type attribute related to types (e.g. "aligned") Attr_struct attribute related to struct/union/enum types (e.g. "packed") Attr_function attribute related to function types (e.g. "noreturn") Attr_name attribute related to variable and function declarations (e.g. "section") Attr_unknown attribute was not declared Cutil.declare_attribute is used to associate a class to a custom attribute. Standard attributes (const, volatile, _Alignas, etc) are Attr_type. cfronted/C2C.ml: declare the few attributes that CompCert honors currently. cparser/GCC.ml: a bigger list of attributes taken from GCC, for reference only. --- cparser/GCC.mli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cparser/GCC.mli') diff --git a/cparser/GCC.mli b/cparser/GCC.mli index 76f40372..f26d12df 100644 --- a/cparser/GCC.mli +++ b/cparser/GCC.mli @@ -13,6 +13,7 @@ (* *) (* *********************************************************************) -(* GCC built-ins *) +(* GCC built-ins and attributes *) val builtins: Builtins.t +val attributes: (string * Cutil.attribute_class) list -- cgit