diff options
author | Chris Lattner <sabre@nondot.org> | 2010-06-19 05:52:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-06-19 05:52:45 +0000 |
commit | 810112e28dc839715d17b0a786f23aaa19600ac0 (patch) | |
tree | be4df999eb856ce5e7be5a6d114df7e82b2533ef /lib/CodeGen/CGDeclCXX.cpp | |
parent | b9d5c22529c3f2bf3b03348021c0fd1c723d8516 (diff) | |
download | clang-810112e28dc839715d17b0a786f23aaa19600ac0.tar.gz |
Fix PR7097, a bad interaction between -fno-use-cxa-atexit and
-mconstructor-aliases by using a WeakVH instead of a raw pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGDeclCXX.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/CodeGen/CGDeclCXX.cpp b/lib/CodeGen/CGDeclCXX.cpp index b890e2f0a4..a59ed0abe6 100644 --- a/lib/CodeGen/CGDeclCXX.cpp +++ b/lib/CodeGen/CGDeclCXX.cpp @@ -193,11 +193,6 @@ CodeGenModule::EmitCXXGlobalInitFunc() { AddGlobalCtor(Fn); } -void CodeGenModule::AddCXXDtorEntry(llvm::Constant *DtorFn, - llvm::Constant *Object) { - CXXGlobalDtors.push_back(std::make_pair(DtorFn, Object)); -} - void CodeGenModule::EmitCXXGlobalDtorFunc() { if (CXXGlobalDtors.empty()) return; @@ -238,14 +233,14 @@ void CodeGenFunction::GenerateCXXGlobalInitFunc(llvm::Function *Fn, } void CodeGenFunction::GenerateCXXGlobalDtorFunc(llvm::Function *Fn, - const std::vector<std::pair<llvm::Constant*, llvm::Constant*> > + const std::vector<std::pair<llvm::WeakVH, llvm::Constant*> > &DtorsAndObjects) { StartFunction(GlobalDecl(), getContext().VoidTy, Fn, FunctionArgList(), SourceLocation()); // Emit the dtors, in reverse order from construction. for (unsigned i = 0, e = DtorsAndObjects.size(); i != e; ++i) { - llvm::Constant *Callee = DtorsAndObjects[e - i - 1].first; + llvm::Value *Callee = DtorsAndObjects[e - i - 1].first; llvm::CallInst *CI = Builder.CreateCall(Callee, DtorsAndObjects[e - i - 1].second); // Make sure the call and the callee agree on calling convention. |