This is an archive of the discontinued LLVM Phabricator instance.

[lldb][FormatEntity][NFC] Move function argument parsing code into separate functions
ClosedPublic

Authored by Michael137 on Oct 28 2022, 2:58 AM.

Details

Summary

Hopefully makes the code more readable and allows
us to re-use argument pretty-printing code from
the CPlusPlusLanguage plugin in a follow-up commit.

Diff Detail

Event Timeline

Michael137 created this revision.Oct 28 2022, 2:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 2:58 AM
Michael137 requested review of this revision.Oct 28 2022, 2:58 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2022, 2:58 AM
aprantl accepted this revision.Oct 28 2022, 12:11 PM
aprantl added inline comments.
lldb/source/Core/FormatEntity.cpp
1057

Would be nice to rewrite this on top of StringRef at some point.

This revision is now accepted and ready to land.Oct 28 2022, 12:11 PM
labath accepted this revision.Oct 31 2022, 4:18 AM
labath added inline comments.
lldb/source/Core/FormatEntity.cpp
1057

After we stop using this for c++, I think we should replace this code with something really simple (e.g., drop everything after the first (), and tell everyone to write their language plugins if they need more.

Michael137 added inline comments.Oct 31 2022, 5:10 AM
lldb/source/Core/FormatEntity.cpp
1057

FYI @aprantl we have a copy of all this in the Swift fork: https://github.com/apple/llvm-project/blob/next/lldb/source/Plugins/Language/Swift/SwiftLanguage.cpp#L1386

Curious whether some of that can be trimmed. Not familiar enough with Swift syntax to say for sure. But looks like some of it could be re-used from FormatEntity