Skip to content

Commit 90dc75c

Browse files
authored
Merge pull request #8930 from apple/bugfix/lldb/redecl-typemap-cache
[lldb][Type Completion] Adjust DIEToType caching for redecel-completion
2 parents 75d9979 + 54c611a commit 90dc75c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,14 +490,16 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
490490
}
491491

492492
// Set a bit that lets us know that we are currently parsing this
493-
if (!TypeSystemClang::UseRedeclCompletion())
494-
if (auto [it, inserted] =
493+
if (TypeSystemClang::UseRedeclCompletion()) {
494+
if (Type *type_ptr = dwarf->GetDIEToType().lookup(die.GetDIE()))
495+
return type_ptr->shared_from_this();
496+
} else if (auto [it, inserted] =
495497
dwarf->GetDIEToType().try_emplace(die.GetDIE(), DIE_IS_BEING_PARSED);
496498
!inserted) {
497499
if (it->getSecond() == nullptr || it->getSecond() == DIE_IS_BEING_PARSED)
498500
return nullptr;
499501
return it->getSecond()->shared_from_this();
500-
}
502+
}
501503

502504
ParsedDWARFTypeAttributes attrs(die);
503505

0 commit comments

Comments
 (0)