summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-06-19 05:52:45 +0000
committerChris Lattner <sabre@nondot.org>2010-06-19 05:52:45 +0000
commit87233f785b253761dd94a6924d117ba7a6ba3690 (patch)
treee1c52f5537ebec45b7ddba29964e684b9a95b88b /clang/lib/CodeGen/CodeGenModule.h
parent4581434c27daed4f693323ff48dbea1b35812805 (diff)
downloadbcm5719-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/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 45931ce0fd3..35383301e0c 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -142,7 +142,7 @@ class CodeGenModule : public BlockModule {
/// CXXGlobalDtors - Global destructor functions and arguments that need to
/// run on termination.
- std::vector<std::pair<llvm::Constant*,llvm::Constant*> > CXXGlobalDtors;
+ std::vector<std::pair<llvm::WeakVH,llvm::Constant*> > CXXGlobalDtors;
/// CFConstantStringClassRef - Cached reference to the class for constant
/// strings. This value has type int * but is actually an Obj-C class pointer.
@@ -350,7 +350,9 @@ public:
/// AddCXXDtorEntry - Add a destructor and object to add to the C++ global
/// destructor function.
- void AddCXXDtorEntry(llvm::Constant *DtorFn, llvm::Constant *Object);
+ void AddCXXDtorEntry(llvm::Constant *DtorFn, llvm::Constant *Object) {
+ CXXGlobalDtors.push_back(std::make_pair(DtorFn, Object));
+ }
/// CreateRuntimeFunction - Create a new runtime function with the specified
/// type and name.
OpenPOWER on IntegriCloud