summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/PDB
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2018-12-03 19:05:12 +0000
committerZachary Turner <zturner@google.com>2018-12-03 19:05:12 +0000
commit1e0cce796cd20b5b61bb37355637f3d919a657a5 (patch)
treeb43f234e5fd26386f20a697b7c5256b262b75a33 /llvm/lib/DebugInfo/PDB
parentb77711e297f55b09f4dbf0c8f4424752434c899a (diff)
downloadbcm5719-llvm-1e0cce796cd20b5b61bb37355637f3d919a657a5.tar.gz
bcm5719-llvm-1e0cce796cd20b5b61bb37355637f3d919a657a5.zip
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
Diffstat (limited to 'llvm/lib/DebugInfo/PDB')
-rw-r--r--llvm/lib/DebugInfo/PDB/Native/TpiStream.cpp6
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;
OpenPOWER on IntegriCloud