This is an archive of the discontinued LLVM Phabricator instance.

[lldb][NFCish] Move DWARFDebugInfoEntry::GetQualifiedName() into DWARFASTParserClang
ClosedPublic

Authored by aeubanks on Oct 14 2022, 11:37 AM.

Details

Summary

In D134378, we'll need the clang AST to be able to construct the qualified in some cases.

This makes logging in one place slightly less informative.

Diff Detail

Event Timeline

aeubanks created this revision.Oct 14 2022, 11:37 AM
Herald added a project: Restricted Project. · View Herald Transcript
aeubanks requested review of this revision.Oct 14 2022, 11:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 14 2022, 11:37 AM
dblaikie accepted this revision.Oct 14 2022, 12:13 PM

Looked like this was a fairly uncontroversial part of the other patch, so I feel confident approving it - but welcome to wait for a second opinion from more lldb-affiliated developers.

This revision is now accepted and ready to land.Oct 14 2022, 12:13 PM
Michael137 added inline comments.
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
1602

Overall LGTM. Correct me if I missed something, but the main functional change is that previously when GetQualifiedName returned nullptr we didn't re-assign it to unique_typename. However, now we would unconditionally assign. Does that matter? Should we only re-assign if the string is non-empty? Or should we use some Optional type?

aeubanks updated this revision to Diff 467916.Oct 14 2022, 2:28 PM

check if string is empty before assigning to unique_typename

aeubanks marked an inline comment as done.Oct 14 2022, 2:28 PM
Michael137 accepted this revision.Oct 14 2022, 3:34 PM
shafik added inline comments.Oct 14 2022, 4:50 PM
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
1534

So it looks like you can do SymbolFileDWARF::GetDWARFDeclContext(...) and DWARFDeclContext has GetQualifiedName() which I think is doing what you are doing below and maybe handles more cases.

aeubanks added inline comments.Oct 14 2022, 5:04 PM
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
1534

DWARFDeclContext doesn't have access to the clang AST, which in D134378 we will use to reconstruct template parameters (I hope I'm understanding your suggestion correctly, still new to lldb)