Skip to content

Commit

Permalink
DIE-to-consumer (string, in this case) matching, with quick exit on f…
Browse files Browse the repository at this point in the history
…ailure
  • Loading branch information
dwblaikie committed Jun 7, 2024
1 parent 5da641c commit 334301a
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 222 deletions.
7 changes: 7 additions & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,3 +564,10 @@ std::optional<DWARFFormValue> DWARFDIE::find(const dw_attr_t attr) const {
return form_value;
return std::nullopt;
}

std::optional<uint64_t> llvm::getLanguage(lldb_private::plugin::dwarf::DWARFDIE D) {
if (auto I = D.GetCU()->GetDWARFLanguageType())
return I;
return std::nullopt;
}

4 changes: 4 additions & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,8 @@ class DWARFDIE::child_iterator
} // namespace dwarf
} // namespace lldb_private::plugin

namespace llvm {
std::optional<uint64_t> getLanguage(lldb_private::plugin::dwarf::DWARFDIE D);
}

#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDIE_H
1 change: 1 addition & 0 deletions lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,7 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
llvm::StringRef remaining = Context.front().name;
auto Visitor = [&](llvm::StringRef S) {
Success &= remaining.consume_front(S);
return Success;
};
llvm::DWARFTypePrinter<DWARFDIE, decltype(Visitor)> p(Visitor);
p.appendQualifiedName(die);
Expand Down
Loading

0 comments on commit 334301a

Please sign in to comment.