[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
Wed Nov 4 15:01:59 PST 2020


michaelrj created this revision.
michaelrj added a reviewer: sivachandra.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added a project: libc-project.
michaelrj requested review of this revision.

This corrects WrapperGen generating incorrect wrappers for functions
that take no arguments. Previously it would generate a wrapper with a
single argument of type `void`.


Repository:
  rG LLVM Github Monorepo

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,11 @@
   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) {
+      continue;
+    }
+
     OS << TypeName << " " << ArgPrefix << i;
     CallArgs << ArgPrefix << i;
     if (i < ArgsList.size() - 1) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D90800.302979.patch
Type: text/x-patch
Size: 571 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20201104/a10b4812/attachment.bin>


More information about the libc-commits mailing list