aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Cutil.ml
diff options
context:
space:
mode:
Diffstat (limited to 'cparser/Cutil.ml')
-rw-r--r--cparser/Cutil.ml9
1 files changed, 9 insertions, 0 deletions
diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml
index 25329694..cf67015a 100644
--- a/cparser/Cutil.ml
+++ b/cparser/Cutil.ml
@@ -119,6 +119,15 @@ let class_of_attribute = function
try Hashtbl.find attr_class (normalize_attrname name)
with Not_found -> Attr_unknown
+(* Name for printing an attribute *)
+
+let name_of_attribute = function
+ | AConst -> "const"
+ | AVolatile -> "volatile"
+ | ARestrict -> "restrict"
+ | AAlignas n -> "_Alignas"
+ | Attr(name, _) -> name
+
(* Is an attribute a ISO C standard attribute? *)
let attr_is_standard = function