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 | 87233f785b253761dd94a6924d117ba7a6ba3690 (patch) | |
tree | e1c52f5537ebec45b7ddba29964e684b9a95b88b /clang/lib/CodeGen/CGDeclCXX.cpp | |
parent | 4581434c27daed4f693323ff48dbea1b35812805 (diff) | |
download | bcm5719-llvm-87233f785b253761dd94a6924d117ba7a6ba3690.tar.gz bcm5719-llvm-87233f785b253761dd94a6924d117ba7a6ba3690.zip |
Fix PR7097, a bad interaction between -fno-use-cxa-atexit and
-mconstructor-aliases by using a WeakVH instead of a raw pointer.
llvm-svn: 106384
Diffstat (limited to 'clang/lib/CodeGen/CGDeclCXX.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDeclCXX.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGDeclCXX.cpp b/clang/lib/CodeGen/CGDeclCXX.cpp index b890e2f0a47..a59ed0abe62 100644 --- a/clang/lib/CodeGen/CGDeclCXX.cpp +++ b/clang/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. |