summaryrefslogtreecommitdiff
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
commit75cc051139ab4e1a5d3177d81820cf3d7110cd0a (patch)
tree9185a415c34a1580fbef9a22dd9907cb20b15429
parent9507885b185f5f39b3d9e7167ee031355bdc16e5 (diff)
IR: Use Optional instead of unique_ptr for debug info ODR type map, NFC
Save a level of malloc indirection. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266749 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/IR/LLVMContext.cpp3
-rw-r--r--lib/IR/LLVMContextImpl.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/lib/IR/LLVMContext.cpp b/lib/IR/LLVMContext.cpp
index 0d4f7242b76..45c28061b0c 100644
--- a/lib/IR/LLVMContext.cpp
+++ b/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/lib/IR/LLVMContextImpl.h b/lib/IR/LLVMContextImpl.h
index 15ac0309831..2938421080b 100644
--- a/lib/IR/LLVMContextImpl.h
+++ b/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