This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj/llvm-readelf] - .stack_sizes: demangle symbol names in warnings reported.
ClosedPublic

Authored by grimar on Sep 25 2019, 2:47 AM.

Details

Summary

I started this patch as a refactoring, tried to make a helper for
getting symbol names, similar to how we get section names
used in warning messages.

So this patch cleanups the code and fixes an issue: symbol names
in warning messages were not demangled.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Sep 25 2019, 2:47 AM
grimar marked an inline comment as done.Sep 25 2019, 2:47 AM
grimar added a subscriber: wolfgangp.
grimar added inline comments.
tools/llvm-readobj/ELFDumper.cpp
4822 ↗(On Diff #221695)

It was unnecessary to touch this, but I decided that it is nice to move it closer to the new getSymbolName helper.

grimar edited the summary of this revision. (Show Details)Sep 25 2019, 2:53 AM
jhenderson added inline comments.Sep 25 2019, 3:13 AM
tools/llvm-readobj/ELFDumper.cpp
4786 ↗(On Diff #221695)

Since we're now demangling these symbols, I wonder if it would make sense here and in the other warning to quote the symbol names, because demangled names can be phrases rather than individual names. Quoting would make the name easier to read, I think.

grimar updated this revision to Diff 221731.Sep 25 2019, 5:52 AM
grimar marked an inline comment as done.
  • Addressed review comments.
  • Added a test case for another warning too.
tools/llvm-readobj/ELFDumper.cpp
4786 ↗(On Diff #221695)

Sounds good. Done.

jhenderson accepted this revision.Sep 25 2019, 6:05 AM

LGTM, thanks!

This revision is now accepted and ready to land.Sep 25 2019, 6:05 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2019, 6:19 AM