[PATCH] MS ABI: Implement copy-ctor closures, finish implementing throw
Reid Kleckner
rnk at google.com
Tue Mar 10 14:26:33 PDT 2015
================
Comment at: lib/AST/MicrosoftMangle.cpp:790
@@ -776,1 +789,3 @@
+ } else {
+ Out << "?0";
}
----------------
Keep the Ctor_Complete assertion to avoid decl mangling collisions?
================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:3332-3335
@@ +3331,6 @@
+ CallingConv ActualCallingConv = CD->getType()
+ ->getCanonicalTypeUnqualified()
+ .getAs<FunctionProtoType>()
+ ->getExtInfo()
+ .getCC();
+ if (ExpectedCallingConv != ActualCallingConv || CD->getNumParams() != 1)
----------------
Surely this can be:
CD->getType()->getAs<FunctionType>()->getCallConv()?
Does the canonical unqualified type step matter in practice?
================
Comment at: lib/CodeGen/MicrosoftCXXABI.cpp:3336
@@ +3335,3 @@
+ .getCC();
+ if (ExpectedCallingConv != ActualCallingConv || CD->getNumParams() != 1)
+ CT = Ctor_Closure;
----------------
Can you test the calling convention difference case and the variadic case?
================
Comment at: lib/Sema/SemaExprCXX.cpp:829
@@ -793,1 +828,3 @@
+ BuildCXXDefaultArgExpr(ThrowLoc, CD, CD->getParamDecl(I)).get();
+ Context.addDefaultArgExprForConstructor(CD, I, DefaultArg);
}
----------------
I can see that you need to call BuildCXXDefautlArgExpr to do all the necessary semantic checking, but is it really necessary to maintain a map of all the CXXDefaultArgExprs, rather than simply calling ParmVarDecl::getDefaultArgExpr() during CodeGen?
http://reviews.llvm.org/D8225
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list