[PATCH] D17462: Fix a codegen bug for variadic functions with pass_object_size params

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 16 12:30:49 PDT 2016


rsmith added inline comments.

================
Comment at: lib/CodeGen/CGExprCXX.cpp:57-58
@@ -56,2 +56,4 @@
   const FunctionProtoType *FPT = MD->getType()->castAs<FunctionProtoType>();
-  RequiredArgs required = RequiredArgs::forPrototypePlus(FPT, Args.size());
+  // Don't pass in the MethodDecl, because we should already have the
+  // pass_object_size values in the arglist.
+  RequiredArgs required = RequiredArgs::forPrototypePlus(FPT, Args.size(), MD);
----------------
Comment doesn't seem to match the code; `Args.size()` here includes only the 'this' pointer and the possible destructor VTT parameter. Delete comment?

================
Comment at: lib/CodeGen/CGExprCXX.cpp:331
@@ -329,3 +330,3 @@
   // And the rest of the call args
   EmitCallArgs(Args, FPT, E->arguments(), E->getDirectCallee());
   return EmitCall(CGM.getTypes().arrangeCXXMethodCall(Args, FPT, required),
----------------
Seems inconsistent to pass `E->getDirectCallee()` here but not above. Since you can't take the address of a pass_object_size function, do we need to pass the callee in either place?


http://reviews.llvm.org/D17462





More information about the cfe-commits mailing list