[libc-commits] [libc] [libc][RFC] add support for function level attributes (PR #79891)

Schrodinger ZHU Yifan via libc-commits libc-commits at lists.llvm.org
Wed Jan 31 06:55:23 PST 2024


================
@@ -169,10 +169,30 @@ class ArgSpec<Type type, list<Annotation> annotations = [], string name = ""> {
   string Name = name;
 }
 
-class FunctionSpec<string name, RetValSpec return, list<ArgSpec> args> {
+class FunctionAttr {}
+class GnuFunctionAttr<string attr> : FunctionAttr {
+  string Attr = attr;
+  string Style = "gnu";
+}
+class Cxx11FunctionAttr<string attr, string namespace> : FunctionAttr {
+  string Attr = attr;
+  string Namespace = namespace;
+  string Style = "cxx11";
+}
+class DeclspecFunctionAttr<string attr> : FunctionAttr {
+  string Attr = attr;
+  string Style = "declspec";
+}
+class FunctionAttrSpec<string macro, list<FunctionAttr> instances> {
+  list<FunctionAttr> Instances = instances;
+  string Macro = macro;
+}
----------------
SchrodingerZhu wrote:

Mentioned in comment.

https://github.com/llvm/llvm-project/pull/79891


More information about the libc-commits mailing list