diff options
author | Reid Kleckner <reid@kleckner.net> | 2014-01-31 22:54:50 +0000 |
---|---|---|
committer | Reid Kleckner <reid@kleckner.net> | 2014-01-31 22:54:50 +0000 |
commit | 4982b82b739199de64e852b114cd70b65a29cf8c (patch) | |
tree | 5294c690c21731953b26695fdb6032f74394b17c /clang/lib/CodeGen/CGObjC.cpp | |
parent | 394e34f5c2ed7d33b81dc3abdc7687af0b7ceb1a (diff) | |
download | bcm5719-llvm-4982b82b739199de64e852b114cd70b65a29cf8c.tar.gz bcm5719-llvm-4982b82b739199de64e852b114cd70b65a29cf8c.zip |
[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
llvm-svn: 200587
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index ae1349fbd8a..9a0b15d434c 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -2900,12 +2900,10 @@ CodeGenFunction::GenerateObjCAtomicSetterCopyHelperFunction( args.push_back(&dstDecl); ImplicitParamDecl srcDecl(FD, SourceLocation(), 0, SrcTy); args.push_back(&srcDecl); - - const CGFunctionInfo &FI = - CGM.getTypes().arrangeFunctionDeclaration(C.VoidTy, args, - FunctionType::ExtInfo(), - RequiredArgs::All); - + + const CGFunctionInfo &FI = CGM.getTypes().arrangeFreeFunctionDeclaration( + C.VoidTy, args, FunctionType::ExtInfo(), RequiredArgs::All); + llvm::FunctionType *LTy = CGM.getTypes().GetFunctionType(FI); llvm::Function *Fn = @@ -2981,12 +2979,10 @@ CodeGenFunction::GenerateObjCAtomicGetterCopyHelperFunction( args.push_back(&dstDecl); ImplicitParamDecl srcDecl(FD, SourceLocation(), 0, SrcTy); args.push_back(&srcDecl); - - const CGFunctionInfo &FI = - CGM.getTypes().arrangeFunctionDeclaration(C.VoidTy, args, - FunctionType::ExtInfo(), - RequiredArgs::All); - + + const CGFunctionInfo &FI = CGM.getTypes().arrangeFreeFunctionDeclaration( + C.VoidTy, args, FunctionType::ExtInfo(), RequiredArgs::All); + llvm::FunctionType *LTy = CGM.getTypes().GetFunctionType(FI); llvm::Function *Fn = |