This is an archive of the discontinued LLVM Phabricator instance.

[LLD] COFF: Define error categories for Driver, Reader and Resolver.
ClosedPublic

Authored by ruiu on May 29 2015, 10:30 AM.

Details

Reviewers
rafael
Summary

Now the errors are categorized so that you can handle them programmatically.
All uses of make_dynamic_error_code are removed.

Because we don't have error reporting mechanism, I just chose to print out
error messages to stdout, and then return an error object. Not sure if
that's the right thing to do, but at least it seems practical.

I'm not very happy about the size of Error.h and its density.
That defines only a few things but it is almost 100 lines long.
Maybe it's unavoidable?

Diff Detail

Event Timeline

ruiu updated this revision to Diff 26794.May 29 2015, 10:30 AM
ruiu retitled this revision from to [LLD] COFF: Define error categories for Driver, Reader and Resolver..
ruiu updated this object.
ruiu edited the test plan for this revision. (Show Details)
ruiu added a reviewer: rafael.
ruiu added a subscriber: Unknown Object (MLST).
rafael accepted this revision.May 31 2015, 3:05 PM
rafael edited edge metadata.

LGTM, just check if you really need the various ways of saying Success.

COFF/Error.h
21

I don't think you need Success. You can just use std::error_code(), no?

This revision is now accepted and ready to land.May 31 2015, 3:05 PM
ruiu added inline comments.May 31 2015, 4:05 PM
COFF/Error.h
21

Correct. I'll remove that.

Does it make sense to merge all the error categories into one LLDErrorCategory and let the caller distinguish error type by its value? What do you think?

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r238714.