summaryrefslogtreecommitdiff
path: root/lib/VMCore/LLVMContextImpl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2012-01-23 08:52:32 +0000
committerChris Lattner <sabre@nondot.org>2012-01-23 08:52:32 +0000
commit3755615411713b2b27b1b2ffd3886584295843d1 (patch)
treeca55634b6aa11c5ef0b9579f2e1f808c10f58794 /lib/VMCore/LLVMContextImpl.cpp
parent300a263d93ba4bb320ae303ca5a388dc9800b112 (diff)
downloadllvm-3755615411713b2b27b1b2ffd3886584295843d1.tar.gz
llvm-3755615411713b2b27b1b2ffd3886584295843d1.tar.bz2
llvm-3755615411713b2b27b1b2ffd3886584295843d1.tar.xz
switch UndefValue and ConstantPointerNull over to DenseMap's for uniquing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/LLVMContextImpl.cpp')
-rw-r--r--lib/VMCore/LLVMContextImpl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/VMCore/LLVMContextImpl.cpp b/lib/VMCore/LLVMContextImpl.cpp
index 7ab3ccec62..de851ee4bb 100644
--- a/lib/VMCore/LLVMContextImpl.cpp
+++ b/lib/VMCore/LLVMContextImpl.cpp
@@ -58,6 +58,8 @@ LLVMContextImpl::~LLVMContextImpl() {
std::vector<Module*> Modules(OwnedModules.begin(), OwnedModules.end());
DeleteContainerPointers(Modules);
+ // Free the constants. This is important to do here to ensure that they are
+ // freed before the LeakDetector is torn down.
std::for_each(ExprConstants.map_begin(), ExprConstants.map_end(),
DropReferences());
std::for_each(ArrayConstants.map_begin(), ArrayConstants.map_end(),
@@ -71,8 +73,8 @@ LLVMContextImpl::~LLVMContextImpl() {
StructConstants.freeConstants();
VectorConstants.freeConstants();
CAZConstants.clear();
- NullPtrConstants.freeConstants();
- UndefValueConstants.freeConstants();
+ CPNConstants.clear();
+ UVConstants.clear();
InlineAsms.freeConstants();
DeleteContainerSeconds(IntConstants);
DeleteContainerSeconds(FPConstants);