diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-19 14:42:55 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2016-04-19 14:42:55 +0000 |
commit | 86f1bf98dc518177ed78c16fa97a18f3deaa12da (patch) | |
tree | 2adfab32ccf289f4b2b0236a451b50d47bb05abf /llvm/lib/IR | |
parent | 6145366510197e52862236960816c14b6e687004 (diff) | |
download | bcm5719-llvm-86f1bf98dc518177ed78c16fa97a18f3deaa12da.tar.gz bcm5719-llvm-86f1bf98dc518177ed78c16fa97a18f3deaa12da.zip |
IR: Require DICompositeType for ODR uniquing type map
Tighten up the API for debug info ODR type uniquing in LLVMContext. The
only reason to allow other DIType subclasses is to make the unit tests
prettier :/.
llvm-svn: 266737
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r-- | llvm/lib/IR/LLVMContext.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/IR/LLVMContextImpl.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp index e166a551ade..7c0d18d028a 100644 --- a/llvm/lib/IR/LLVMContext.cpp +++ b/llvm/lib/IR/LLVMContext.cpp @@ -317,12 +317,13 @@ void LLVMContext::enableDebugTypeODRUniquing() { if (pImpl->DITypeMap) return; - pImpl->DITypeMap = llvm::make_unique<DenseMap<const MDString *, DIType *>>(); + pImpl->DITypeMap = + llvm::make_unique<DenseMap<const MDString *, DICompositeType *>>(); } void LLVMContext::disableDebugTypeODRUniquing() { pImpl->DITypeMap.reset(); } -DIType **LLVMContext::getOrInsertODRUniquedType(const MDString &S) { +DICompositeType **LLVMContext::getOrInsertODRUniquedType(const MDString &S) { if (!isODRUniquingDebugTypes()) return nullptr; return &(*pImpl->DITypeMap)[&S]; diff --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h index e1a5aa52cb9..15ac0309831 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 *, DIType *>> DITypeMap; + std::unique_ptr<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 |