This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cxxdump] Don't rely on global state
ClosedPublic

Authored by davide on Jul 15 2015, 10:50 AM.

Details

Summary

It seems that llvm-cxxdump (and other tools) rely on a static global state for error. It doesn't seem great, and I can't see a reason why we need to do that (but I may miss it).
At least in the llvm-cxxdump case the conversion seems straightforward enough, so I tried to do it.

Diff Detail

Event Timeline

davide updated this revision to Diff 29795.Jul 15 2015, 10:50 AM
davide updated this revision to Diff 29796.
davide retitled this revision from to [llvm-cxxdump] Don't rely on global state.
davide updated this object.
davide added reviewers: majnemer, rafael.
davide added a subscriber: llvm-commits.

Actually return EXIT_{FAILURE, SUCCESS} instead of false/true.

rafael edited edge metadata.Jul 15 2015, 10:24 PM

Given what this tool is, can't we just call exit(1) from reportError?

davide updated this revision to Diff 29951.Jul 16 2015, 3:06 PM
davide edited edge metadata.

Take two.

rafael accepted this revision.Jul 16 2015, 3:34 PM
rafael edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jul 16 2015, 3:34 PM
This revision was automatically updated to reflect the committed changes.