From 196ac334f32f81d9fe040d51de4117c86c7087bf Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Thu, 11 Sep 2014 23:05:02 +0000 Subject: MS ABI: Use the correct this arg when generating implict copy ctor We assumed that the incoming this argument would be the last argument. However, this is not true under the MS ABI. This fixes PR20897. llvm-svn: 217642 --- clang/lib/CodeGen/ItaniumCXXABI.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/CodeGen/ItaniumCXXABI.cpp') diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp index 25e2715daaf..bcc0f166203 100644 --- a/clang/lib/CodeGen/ItaniumCXXABI.cpp +++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp @@ -208,6 +208,12 @@ public: llvm::Value *performReturnAdjustment(CodeGenFunction &CGF, llvm::Value *Ret, const ReturnAdjustment &RA) override; + size_t getSrcArgforCopyCtor(const CXXConstructorDecl *, + FunctionArgList &Args) const override { + assert(!Args.empty() && "expected the arglist to not be empty!"); + return Args.size() - 1; + } + StringRef GetPureVirtualCallName() override { return "__cxa_pure_virtual"; } StringRef GetDeletedVirtualCallName() override { return "__cxa_deleted_virtual"; } -- cgit v1.2.3