diff options
-rw-r--r-- | llvm/lib/IR/LLVMContext.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 2 |
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 |