diff options
Diffstat (limited to 'llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp')
-rw-r--r-- | llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp index eadecadc2a7..f234d446e6a 100644 --- a/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp +++ b/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp @@ -160,6 +160,9 @@ void TpiStream::buildHashMap() { } std::vector<TypeIndex> TpiStream::findRecordsByName(StringRef Name) const { + if (!supportsTypeLookup()) + const_cast<TpiStream*>(this)->buildHashMap(); + uint32_t Bucket = hashStringV1(Name) % Header->NumHashBuckets; if (Bucket > HashMap.size()) return {}; @@ -177,6 +180,9 @@ bool TpiStream::supportsTypeLookup() const { return !HashMap.empty(); } Expected<TypeIndex> TpiStream::findFullDeclForForwardRef(TypeIndex ForwardRefTI) const { + if (!supportsTypeLookup()) + const_cast<TpiStream*>(this)->buildHashMap(); + CVType F = Types->getType(ForwardRefTI); if (!isUdtForwardRef(F)) return ForwardRefTI; |