summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/LLVMContextImpl.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-08-19 00:42:32 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-08-19 00:42:32 +0000
commit8d12558bad480493253c4bdc793244673a78e2c4 (patch)
tree27b79157e82b4103a0c9a088ce48e8150b4a5662 /llvm/lib/IR/LLVMContextImpl.cpp
parent3fa26b7661273baf0f059ff9f1b067c4b70cc7ab (diff)
downloadbcm5719-llvm-8d12558bad480493253c4bdc793244673a78e2c4.tar.gz
bcm5719-llvm-8d12558bad480493253c4bdc793244673a78e2c4.zip
IR: Rewrite ConstantUniqueMap
Rewrite `ConstantUniqueMap` to be more similar to `ConstantAggrUniqueMap`. - Use a `DenseMap` with custom MapInfo instead of a `std::map` with linear lookups and deletion. - Don't waste memory explicitly storing (heavyweight) keys. Only `ConstantExpr` and `InlineAsm` actually use this data structure, so I also updated them to use it. This code cleanup is a precursor to reducing RAUW traffic on `ConstantExpr` -- I felt badly adding a new (linear) call to `ConstantUniqueMap::FindExistingKey`, so this designs away the concern. A follow-up commit will transition the users of `ConstantAggrUniqueMap` over. llvm-svn: 215957
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.cpp')
-rw-r--r--llvm/lib/IR/LLVMContextImpl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContextImpl.cpp b/llvm/lib/IR/LLVMContextImpl.cpp
index 4c2791f0a8d..6513965ae7a 100644
--- a/llvm/lib/IR/LLVMContextImpl.cpp
+++ b/llvm/lib/IR/LLVMContextImpl.cpp
@@ -75,7 +75,7 @@ LLVMContextImpl::~LLVMContextImpl() {
// 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());
+ DropFirst());
std::for_each(ArrayConstants.map_begin(), ArrayConstants.map_end(),
DropFirst());
std::for_each(StructConstants.map_begin(), StructConstants.map_end(),
OpenPOWER on IntegriCloud