summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 16:06:50 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2016-04-19 16:06:50 +0000
commite8b555c6bb93cd3431a18a624bff81020bec2a3b (patch)
tree45b50ac2b2e1fa4149ad5620f34f823a0b85f618
parentd6b44aad313c3d3dbb1f0749301eb79e8a9ba32c (diff)
downloadbcm5719-llvm-e8b555c6bb93cd3431a18a624bff81020bec2a3b.tar.gz
bcm5719-llvm-e8b555c6bb93cd3431a18a624bff81020bec2a3b.zip
IR: Use Optional instead of unique_ptr for debug info ODR type map, NFC
Save a level of malloc indirection. llvm-svn: 266749
-rw-r--r--llvm/lib/IR/LLVMContext.cpp3
-rw-r--r--llvm/lib/IR/LLVMContextImpl.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 0d4f7242b76..45c28061b0c 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -317,8 +317,7 @@ void LLVMContext::enableDebugTypeODRUniquing() {
if (pImpl->DITypeMap)
return;
- pImpl->DITypeMap =
- llvm::make_unique<DenseMap<const MDString *, DICompositeType *>>();
+ pImpl->DITypeMap.emplace();
}
void LLVMContext::disableDebugTypeODRUniquing() { pImpl->DITypeMap.reset(); }
diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 15ac0309831..2938421080b 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -1022,7 +1022,7 @@ public:
#include "llvm/IR/Metadata.def"
// Optional map for looking up composite types by identifier.
- std::unique_ptr<DenseMap<const MDString *, DICompositeType *>> DITypeMap;
+ Optional<DenseMap<const MDString *, DICompositeType *>> DITypeMap;
// MDNodes may be uniqued or not uniqued. When they're not uniqued, they
// aren't in the MDNodeSet, but they're still shared between objects, so no
OpenPOWER on IntegriCloud