From 1e0cce796cd20b5b61bb37355637f3d919a657a5 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Mon, 3 Dec 2018 19:05:12 +0000 Subject: [PATCH] Fix issue with Tpi Stream hash map. Part of the patch to not build the hash map eagerly was omitted due to a merge conflict. Add it back, which should fix the failing tests. llvm-svn: 348166 --- llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp b/llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp index eadecad..f234d44 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 TpiStream::findRecordsByName(StringRef Name) const { + if (!supportsTypeLookup()) + const_cast(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 TpiStream::findFullDeclForForwardRef(TypeIndex ForwardRefTI) const { + if (!supportsTypeLookup()) + const_cast(this)->buildHashMap(); + CVType F = Types->getType(ForwardRefTI); if (!isUdtForwardRef(F)) return ForwardRefTI; -- 2.7.4