This is an archive of the discontinued LLVM Phabricator instance.

[Assembler] Allow non-fatal errors after parsing
ClosedPublic

Authored by olista01 on Nov 16 2015, 11:02 AM.

Details

Summary

This adds reportError to MCContext, which can be used as an alternative to reportFatalError when the assembler wants to try to continue processing the rest of the file after the error is reported, so that all of the errors ina file can be reported. It records the fact that an error was encountered, so we can avoid emitting an object file if any errors occurred.

This patch doesn't add any uses of this function (a later patch will convert most uses of reportFatalError to use it), but there is a small functional change: we use the SourceManager to print the error message, even if we have a null SMLoc. This means that we get a SourceManager-style message, with the file and line information shown as <unknown>, rather than the "LLVM ERROR" style used by report_fatal_error.

Diff Detail

Event Timeline

olista01 updated this revision to Diff 40313.Nov 16 2015, 11:02 AM
olista01 retitled this revision from to [Assembler] Allow non-fatal errors after parsing.
olista01 updated this object.
olista01 added a reviewer: rengolin.
olista01 set the repository for this revision to rL LLVM.
olista01 added a subscriber: llvm-commits.
t.p.northover accepted this revision.Nov 16 2015, 12:50 PM
t.p.northover added a reviewer: t.p.northover.
t.p.northover added a subscriber: t.p.northover.

This seems fine to me.

Tim.

This revision is now accepted and ready to land.Nov 16 2015, 12:50 PM
olista01 closed this revision.Nov 17 2015, 2:00 AM

Committed revision 253327.