diff options
author | Tilmann Scheller <tilmann.scheller@googlemail.com> | 2011-03-02 19:36:23 +0000 |
---|---|---|
committer | Tilmann Scheller <tilmann.scheller@googlemail.com> | 2011-03-02 19:36:23 +0000 |
commit | 88d117c2eedd7c5bec57ac983a98d5e12bdd2cc6 (patch) | |
tree | 8ffc9cc441cf35e4ac650b20dde423ebe58a8641 /lib/CodeGen/CGVTables.cpp | |
parent | c314aa484524c6a310a51e7b83bc194774e95e90 (diff) |
Add CC_Win64ThisCall and set it in the necessary places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126863 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGVTables.cpp')
-rw-r--r-- | lib/CodeGen/CGVTables.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/CodeGen/CGVTables.cpp b/lib/CodeGen/CGVTables.cpp index 891697f4cd..6acbe436c8 100644 --- a/lib/CodeGen/CGVTables.cpp +++ b/lib/CodeGen/CGVTables.cpp @@ -2582,8 +2582,11 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn, GlobalDecl GD, FunctionArgs.push_back(std::make_pair(Param, Param->getType())); } - - StartFunction(GlobalDecl(), ResultType, Fn, FunctionArgs, SourceLocation()); + + const bool IsWin64 = CGM.getContext().Target.isWin64(); + + StartFunction(GlobalDecl(), ResultType, Fn, FunctionArgs, SourceLocation(), + IsWin64 ? CC_Win64ThisCall : CC_Default); CGM.getCXXABI().EmitInstanceFunctionProlog(*this); @@ -2614,9 +2617,14 @@ void CodeGenFunction::GenerateThunk(llvm::Function *Fn, GlobalDecl GD, FPT->isVariadic()); llvm::Value *Callee = CGM.GetAddrOfFunction(GD, Ty, /*ForVTable=*/true); + FunctionType::ExtInfo Info = FPT->getExtInfo(); + + if (IsWin64) { + Info = Info.withCallingConv(CC_Win64ThisCall); + } + const CGFunctionInfo &FnInfo = - CGM.getTypes().getFunctionInfo(ResultType, CallArgs, - FPT->getExtInfo()); + CGM.getTypes().getFunctionInfo(ResultType, CallArgs, Info); // Determine whether we have a return value slot to use. ReturnValueSlot Slot; |