[libc-commits] [PATCH] D90800: [libc] Fix WrapperGen seeing no arguments as a void argument.

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Thu Nov 5 11:13:47 PST 2020


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5c801de13cc2: [libc] Fix WrapperGen seeing no arguments as a void argument. (authored by michaelrj).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90800/new/

https://reviews.llvm.org/D90800

Files:
  libc/utils/tools/WrapperGen/Main.cpp


Index: libc/utils/tools/WrapperGen/Main.cpp
===================================================================
--- libc/utils/tools/WrapperGen/Main.cpp
+++ libc/utils/tools/WrapperGen/Main.cpp
@@ -47,6 +47,20 @@
   for (size_t i = 0; i < ArgsList.size(); ++i) {
     llvm::Record *ArgType = ArgsList[i]->getValueAsDef("ArgType");
     auto TypeName = Indexer.getTypeAsString(ArgType);
+
+    if (TypeName.compare("void") == 0) {
+      if (ArgsList.size() == 1) {
+        break;
+      } else {
+        // the reason this is a fatal error is that a void argument means this
+        // function has no arguments; multiple copies of no arguments is an
+        // error.
+        llvm::PrintFatalError(
+            "The specification for function " + FunctionName +
+            " lists other arguments along with a void argument.");
+      }
+    }
+
     OS << TypeName << " " << ArgPrefix << i;
     CallArgs << ArgPrefix << i;
     if (i < ArgsList.size() - 1) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90800.303196.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20201105/8f871e63/attachment-0001.bin>


More information about the libc-commits mailing list