From 89077a1b008a575c148e08f138aa7c270d4f7323 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Tue, 17 Dec 2013 19:46:40 +0000 Subject: [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 --- clang/lib/CodeGen/CGCall.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGCall.cpp') 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 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); } -- cgit v1.2.3