From: Zachary Turner Date: Mon, 3 Dec 2018 19:05:12 +0000 (+0000) Subject: Fix issue with Tpi Stream hash map. X-Git-Tag: llvmorg-8.0.0-rc1~3034 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e0cce796cd20b5b61bb37355637f3d919a657a5;p=platform%2Fupstream%2Fllvm.git 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 --- 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;