Skip to content
  • Xavier Leroy's avatar
    Refactor the classification of attributes · 3babd253
    Xavier Leroy authored
    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.
    3babd253