From e6a9903e83ef065d324145e1fce4ed7c238c6ec5 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Fri, 31 Jan 2014 22:54:50 +0000 Subject: [ms-cxxabi] Use x86_cdeclmethodcc for __cdecl methods on win32 This fixes PR15768, where the sret parameter and the 'this' parameter are in the wrong order. Instance methods compiled by MSVC never return records in registers, they always return indirectly through an sret pointer. That sret pointer always comes after the 'this' parameter, for both __cdecl and __thiscall methods. Unfortunately, the same is true for other calling conventions, so we'll have to change the overall approach here relatively soon. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2664 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200587 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CodeGenABITypes.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen/CodeGenABITypes.cpp') diff --git a/lib/CodeGen/CodeGenABITypes.cpp b/lib/CodeGen/CodeGenABITypes.cpp index 29def56d35..fba7184d55 100644 --- a/lib/CodeGen/CodeGenABITypes.cpp +++ b/lib/CodeGen/CodeGenABITypes.cpp @@ -60,10 +60,10 @@ CodeGenABITypes::arrangeCXXMethodType(const CXXRecordDecl *RD, } const CGFunctionInfo & -CodeGenABITypes::arrangeLLVMFunctionInfo(CanQualType returnType, +CodeGenABITypes::arrangeFreeFunctionCall(CanQualType returnType, llvm::ArrayRef argTypes, FunctionType::ExtInfo info, RequiredArgs args) { - return CGM->getTypes().arrangeLLVMFunctionInfo(returnType, argTypes, - info, args); + return CGM->getTypes().arrangeLLVMFunctionInfo( + returnType, /*IsInstanceMethod=*/false, argTypes, info, args); } -- cgit v1.2.3