This is an archive of the discontinued LLVM Phabricator instance.

[symbolizer][NFC] Reorganize parsing input binary file
ClosedPublic

Authored by sepavloff on Aug 6 2023, 1:36 AM.

Details

Summary

Now llvm-symbolizer prints input string if parsing command failed,
whithout explanation that is wrong. As a first step in making the
interface more user-friendly, this change reorganize parsing so that
generation of messages becomes easier.

Diff Detail

Event Timeline

sepavloff created this revision.Aug 6 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 1:36 AM
sepavloff requested review of this revision.Aug 6 2023, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 6 2023, 1:36 AM
ikudrin accepted this revision.Aug 8 2023, 5:49 PM

LGTM

llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
205–212

Use else if here to reduce the nesting.

209–213

The new code has a different result than the old one if, for example, InputString consists of only one word, i.e. ModuleName was set to this word, while with the changed code it remains empty.

This revision is now accepted and ready to land.Aug 8 2023, 5:49 PM
jhenderson accepted this revision.Aug 9 2023, 12:35 AM

LGTM, with nits.

llvm/tools/llvm-symbolizer/llvm-symbolizer.cpp
175

Here and below "is already seen" -> "has already been seen"

181

I'd probably add a blank line before this if.

183

"is already" -> "has already been"
"in command line" -> "on the command-line"

207
211
This revision was landed with ongoing or failed builds.Aug 10 2023, 11:27 PM
This revision was automatically updated to reflect the committed changes.