diff options
author | Reid Kleckner <reid@kleckner.net> | 2013-12-17 19:46:40 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2013-12-17 19:46:40 +0000 |
commit | 89077a1b008a575c148e08f138aa7c270d4f7323 (patch) | |
tree | 36f30bee9777818abc9efb1096f33e92e4e92922 /clang/lib/CodeGen/CGCall.cpp | |
parent | f869ad15a3d86a56d311e80406d4fdaf17060080 (diff) | |
download | bcm5719-llvm-89077a1b008a575c148e08f138aa7c270d4f7323.tar.gz bcm5719-llvm-89077a1b008a575c148e08f138aa7c270d4f7323.zip |
[ms-cxxabi] The 'most derived' ctor parameter usually comes last
Unlike Itanium's VTTs, the 'most derived' boolean or bitfield is the
last parameter for non-variadic constructors, rather than the second.
For variadic constructors, the 'most derived' parameter comes after the
'this' parameter. This affects constructor calls and constructor decls
in a variety of places.
Reviewers: timurrrr
Differential Revision: http://llvm-reviews.chandlerc.com/D2405
llvm-svn: 197518
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 726e808ed08..50cbdb1b071 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -202,16 +202,17 @@ CodeGenTypes::arrangeCXXConstructorDeclaration(const CXXConstructorDecl *D, CanQualType resultType = TheCXXABI.HasThisReturn(GD) ? argTypes.front() : Context.VoidTy; - TheCXXABI.BuildConstructorSignature(D, ctorKind, resultType, argTypes); - CanQual<FunctionProtoType> FTP = GetFormalType(D); - RequiredArgs required = RequiredArgs::forPrototypePlus(FTP, argTypes.size()); - // Add the formal parameters. for (unsigned i = 0, e = FTP->getNumArgs(); i != e; ++i) argTypes.push_back(FTP->getArgType(i)); + TheCXXABI.BuildConstructorSignature(D, ctorKind, resultType, argTypes); + + RequiredArgs required = + (D->isVariadic() ? RequiredArgs(argTypes.size()) : RequiredArgs::All); + FunctionType::ExtInfo extInfo = FTP->getExtInfo(); return arrangeLLVMFunctionInfo(resultType, argTypes, extInfo, required); } |