Skip to content

Commit 334301a

Browse files
committed
DIE-to-consumer (string, in this case) matching, with quick exit on failure
1 parent 5da641c commit 334301a

File tree

4 files changed

+288
-222
lines changed

4 files changed

+288
-222
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,3 +564,10 @@ std::optional<DWARFFormValue> DWARFDIE::find(const dw_attr_t attr) const {
564564
return form_value;
565565
return std::nullopt;
566566
}
567+
568+
std::optional<uint64_t> llvm::getLanguage(lldb_private::plugin::dwarf::DWARFDIE D) {
569+
if (auto I = D.GetCU()->GetDWARFLanguageType())
570+
return I;
571+
return std::nullopt;
572+
}
573+

lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,8 @@ class DWARFDIE::child_iterator
156156
} // namespace dwarf
157157
} // namespace lldb_private::plugin
158158

159+
namespace llvm {
160+
std::optional<uint64_t> getLanguage(lldb_private::plugin::dwarf::DWARFDIE D);
161+
}
162+
159163
#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDIE_H

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2793,6 +2793,7 @@ void SymbolFileDWARF::FindTypes(const TypeQuery &query, TypeResults &results) {
27932793
llvm::StringRef remaining = Context.front().name;
27942794
auto Visitor = [&](llvm::StringRef S) {
27952795
Success &= remaining.consume_front(S);
2796+
return Success;
27962797
};
27972798
llvm::DWARFTypePrinter<DWARFDIE, decltype(Visitor)> p(Visitor);
27982799
p.appendQualifiedName(die);

0 commit comments

Comments
 (0)