[PATCH] [ms-cxxabi] The "most derived" ctor parameter comes last

Timur Iskhodzhanov timurrrr at google.com
Fri Dec 13 10:59:29 PST 2013



================
Comment at: lib/CodeGen/CodeGenFunction.cpp:697
@@ -696,3 +696,3 @@
   CurGD = GD;
-  const CXXMethodDecl *MD;
+  const CXXMethodDecl *MD = 0;
   if ((MD = dyn_cast<CXXMethodDecl>(FD)) && MD->isInstance()) {
----------------
Reid Kleckner wrote:
> Timur Iskhodzhanov wrote:
> > `= 0` is not needed here.
> My thinking was that not having it is too subtle, and the store will be trivially dead-store-eliminated.  I'll raise the MD assignment out of the if instead.
  const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD);
  if (MD && MD->isInstance()) {
    ...

SGTM

================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:798
@@ -801,3 +797,3 @@
 
-  llvm::Value *ImplicitParam = 0;
-  QualType ImplicitParamTy;
+  // C++11 [class.mfct.non-static]p2:
+  //   If a non-static member function of a class X is called for an object that
----------------
Reid Kleckner wrote:
> Timur Iskhodzhanov wrote:
> > I think this deserves a separate patch.
> > Also, why is it MS ABI specific?
> This comes from EmitCXXMemberCall.
ouch, I don't like it even more now :P


http://llvm-reviews.chandlerc.com/D2405



More information about the cfe-commits mailing list