Skip to content

Commit

Permalink
[DebugInfo] Avoid repeated hash lookups (NFC) (llvm#128459)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Feb 24, 2025
1 parent 5c6453d commit 6ad55f1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions llvm/lib/DebugInfo/LogicalView/Readers/LVDWARFReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,12 +565,8 @@ LVScope *LVDWARFReader::processOneDie(const DWARFDie &InputDIE, LVScope *Parent,
// Insert the newly created element into the element symbol table. If the
// element is in the list, it means there are previously created elements
// referencing this element.
if (ElementTable.find(Offset) == ElementTable.end()) {
// No previous references to this offset.
ElementTable.emplace(std::piecewise_construct,
std::forward_as_tuple(Offset),
std::forward_as_tuple(CurrentElement));
} else {
auto [It, Inserted] = ElementTable.try_emplace(Offset, CurrentElement);
if (!Inserted) {
// There are previous references to this element. We need to update the
// element and all the references pointing to this element.
LVElementEntry &Reference = ElementTable[Offset];
Expand Down

0 comments on commit 6ad55f1

Please sign in to comment.