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 | 454464b491307a84ba8bc4aa8a05633984d8e2f7 (patch) | |
| tree | a1a4d16370d306d62580da2f540671ed077a22b8 /clang/lib/CodeGen/CGVTables.cpp | |
| parent | a3769f802179ff364e97050c3c4675ee2a503cb3 (diff) | |
| download | bcm5719-llvm-454464b491307a84ba8bc4aa8a05633984d8e2f7.tar.gz bcm5719-llvm-454464b491307a84ba8bc4aa8a05633984d8e2f7.zip | |
Add CC_Win64ThisCall and set it in the necessary places.
llvm-svn: 126863
Diffstat (limited to 'clang/lib/CodeGen/CGVTables.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGVTables.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp index 891697f4cd0..6acbe436c85 100644 --- a/clang/lib/CodeGen/CGVTables.cpp +++ b/clang/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; |

