This is an archive of the discontinued LLVM Phabricator instance.

[Debugify] Print errors and warnings to stderr
ClosedPublic

Authored by gramanas on May 16 2018, 6:34 AM.

Details

Reviewers
vsk
Summary

Currently debugify clutters the terminal with it's output.
With this patch all the errors and warnings output generated goes to stderr.

The PASS or FAIL still ends up in stdout.

This change let's us use debugify without taking away the ability to pipe the output to other llvm tools.

A followup patch will dump the errors/warnings and the generated IR with the problem to a file.

Diff Detail

Event Timeline

gramanas created this revision.May 16 2018, 6:34 AM

Just like llvm-lit I left the PASS or FAIL to stdout.

On second thoughts this breaks the piping as well. Should I move it to the error stream as well?

vsk added a comment.May 16 2018, 8:59 AM

Just like llvm-lit I left the PASS or FAIL to stdout.

On second thoughts this breaks the piping as well. Should I move it to the error stream as well?

Yes, it’d be great to have piping working with ‘opt -debugify’.

gramanas updated this revision to Diff 147288.May 17 2018, 4:15 AM
  • [Debugify] All output now goes to stderr
vsk accepted this revision.May 17 2018, 6:34 AM
vsk added a subscriber: debug-info.

LGTM, thanks!

This revision is now accepted and ready to land.May 17 2018, 6:34 AM
gramanas updated this revision to Diff 147320.May 17 2018, 7:55 AM

Test that debugify can be safely used with piping

gramanas edited the summary of this revision. (Show Details)May 17 2018, 8:04 AM
gramanas updated this revision to Diff 147339.May 17 2018, 9:58 AM

The tests were missing the input file argument

gramanas updated this revision to Diff 147350.May 17 2018, 10:50 AM

The output of the tests should go to /dev/null

gramanas updated this revision to Diff 147352.May 17 2018, 11:00 AM

fix mistake in tests

vsk added a comment.May 17 2018, 11:08 AM

Thanks for cleaning up the tests further. I think it's worthwhile to not have run lines which clutter up the output because it slows down the llvm-lit -a -Dopt="opt -debugify ..." workflow.

Looks good.

gramanas closed this revision.May 17 2018, 11:27 AM

commited r332642