[libc-commits] [libc] 07c9903 - [libc][NFC] Let var args be treated as a named type in the spec.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Thu Jan 27 09:08:00 PST 2022


Author: Siva Chandra Reddy
Date: 2022-01-27T17:07:21Z
New Revision: 07c9903a8bf755388362c43e1131e9f40c62b808

URL: https://github.com/llvm/llvm-project/commit/07c9903a8bf755388362c43e1131e9f40c62b808
DIFF: https://github.com/llvm/llvm-project/commit/07c9903a8bf755388362c43e1131e9f40c62b808.diff

LOG: [libc][NFC] Let var args be treated as a named type in the spec.

The type names in the spec are just sugar used by the header generator to
generate the function prototype. Giving the VarArgType a name of "..."
allows the header generator to treat and generate the "type name" for var
arg parameters similar to how it does for any other type.

Added: 
    

Modified: 
    libc/spec/spec.td

Removed: 
    


################################################################################
diff  --git a/libc/spec/spec.td b/libc/spec/spec.td
index d19c87d0623a5..d2f194bd966f6 100644
--- a/libc/spec/spec.td
+++ b/libc/spec/spec.td
@@ -36,7 +36,7 @@ class RestrictedPtrType<Type type> : Type {
 }
 
 // Builtin types.
-def VarArgType : Type {}
+def VarArgType : NamedType<"...">;
 def VoidType : NamedType<"void">;
 def IntType : NamedType<"int">;
 def LongType : NamedType<"long">;


        


More information about the libc-commits mailing list