[PATCH] D41801: Fix pretty printing the unspecified param of a variadic function

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 20:13:09 PST 2018

zturner added a comment.

Thanks for finding this and adding a test.  Only one comment, but after that this will be good.

Comment at: tools/llvm-pdbutil/PrettyFunctionDumper.cpp:193-194
+    if (auto SigArguments = Signature->getArguments()) {
+      if (SigArguments->getChildCount() > Arguments->getChildCount())
+        Printer << ", ...";
+    }
This check is pretty unintuitive.  Is it possible to implement just by looking at the last argument and checking if it's a builtin with type unspecified?  Something like

auto Last = SigArguments->getLast();
if (Last->getType() == PDB_Type::Builtin && Last->getBuiltinType() == PDB_BuiltinType::None)

?  Either way, to make sure nobody else has to rediscover this, it would be nice if whatever check we do decide on can be put into a function in `PDBFunctionType` and `PDBFunctionSigType`, so that we can just say `if (Signature->isCVarArgs())` or `if (Func->isCVarArgs())`?



More information about the llvm-commits mailing list