aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDeclCXX.cpp
diff options
context:
space:
mode:
authorTilmann Scheller <tilmann.scheller@googlemail.com>2011-03-02 19:36:23 +0000
committerTilmann Scheller <tilmann.scheller@googlemail.com>2011-03-02 19:36:23 +0000
commit88d117c2eedd7c5bec57ac983a98d5e12bdd2cc6 (patch)
tree8ffc9cc441cf35e4ac650b20dde423ebe58a8641 /lib/CodeGen/CGDeclCXX.cpp
parentc314aa484524c6a310a51e7b83bc194774e95e90 (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/CGDeclCXX.cpp')
-rw-r--r--lib/CodeGen/CGDeclCXX.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp
index 8b37e9af3c..e9c6d003de 100644
--- a/lib/CodeGen/CGDeclCXX.cpp
+++ b/lib/CodeGen/CGDeclCXX.cpp
@@ -261,7 +261,7 @@ void CodeGenFunction::GenerateCXXGlobalVarDeclInitFunc(llvm::Function *Fn,
const VarDecl *D,
llvm::GlobalVariable *Addr) {
StartFunction(GlobalDecl(), getContext().VoidTy, Fn, FunctionArgList(),
- SourceLocation());
+ SourceLocation(), CC_Default);
// Use guarded initialization if the global variable is weak due to
// being a class template's static data member.
@@ -278,7 +278,7 @@ void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
llvm::Constant **Decls,
unsigned NumDecls) {
StartFunction(GlobalDecl(), getContext().VoidTy, Fn, FunctionArgList(),
- SourceLocation());
+ SourceLocation(), CC_Default);
for (unsigned i = 0; i != NumDecls; ++i)
if (Decls[i])
@@ -290,8 +290,10 @@ void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn,
void CodeGenFunction::GenerateCXXGlobalDtorFunc(llvm::Function *Fn,
const std::vector<std::pair<llvm::WeakVH, llvm::Constant*> >
&DtorsAndObjects) {
+ const bool IsWin64 = getContext().Target.isWin64();
+
StartFunction(GlobalDecl(), getContext().VoidTy, Fn, FunctionArgList(),
- SourceLocation());
+ SourceLocation(), IsWin64 ? CC_Win64ThisCall : CC_Default);
// Emit the dtors, in reverse order from construction.
for (unsigned i = 0, e = DtorsAndObjects.size(); i != e; ++i) {
@@ -327,7 +329,8 @@ CodeGenFunction::GenerateCXXAggrDestructorHelper(const CXXDestructorDecl *D,
llvm::Function *Fn =
CreateGlobalInitOrDestructFunction(CGM, FTy, "__cxx_global_array_dtor");
- StartFunction(GlobalDecl(), getContext().VoidTy, Fn, Args, SourceLocation());
+ StartFunction(GlobalDecl(), getContext().VoidTy, Fn, Args, SourceLocation(),
+ CC_Default);
QualType BaseElementTy = getContext().getBaseElementType(Array);
const llvm::Type *BasePtr = ConvertType(BaseElementTy)->getPointerTo();