This is an archive of the discontinued LLVM Phabricator instance.

[llvm-strings] Fix whitespaces to match strings output.
ClosedPublic

Authored by rupprecht on Nov 7 2018, 4:22 PM.

Details

Summary

The current implementation prepends a space on every line, making it difficult to compare against GNU strings.

The space appears to have come from handling --radix in rL292707. The space is for making sure there's a space between the radix and the value; however the space is still emitted even when there is no radix. This change fixes that so the space is only emitted when there is a radix.

Diff Detail

Repository
rL LLVM

Event Timeline

rupprecht created this revision.Nov 7 2018, 4:22 PM

Could you add a test for --radix + --print-file-name, please, as the interaction could have changed with your implementation too. Otherwise looks good.

rupprecht updated this revision to Diff 173200.Nov 8 2018, 11:01 AM
  • Add radix+filename test
jhenderson accepted this revision.Nov 9 2018, 1:52 AM

LGTM.

test/tools/llvm-strings/radix-filename.test
2 ↗(On Diff #173200)

Nit: Use --check-prefix instead of -check-prefix for consistency with --strict-whitespace.

This revision is now accepted and ready to land.Nov 9 2018, 1:52 AM
rupprecht marked an inline comment as done.Nov 9 2018, 10:03 AM
rupprecht updated this revision to Diff 173371.Nov 9 2018, 10:05 AM

fix test flags

This revision was automatically updated to reflect the committed changes.