forked from OSchip/llvm-project
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
This commit is contained in:
parent
b77711e297
commit
1e0cce796c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue