This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix D26214: Move error handling out of MC and to the callers.
ClosedPublic

Authored by mgrang on Dec 2 2016, 11:54 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

mgrang updated this revision to Diff 80115.Dec 2 2016, 11:54 AM
mgrang retitled this revision from to Fix D26214: Move error handling out of MC and to the callers..
mgrang updated this object.
mgrang added a project: Restricted Project.
mgrang added subscribers: llvm-commits, cfe-commits.
mgrang retitled this revision from Fix D26214: Move error handling out of MC and to the callers. to [clang] Fix D26214: Move error handling out of MC and to the callers..Dec 2 2016, 11:55 AM
dgross resigned from this revision.Dec 2 2016, 12:01 PM
dgross removed a reviewer: dgross.
compnerd edited edge metadata.Dec 2 2016, 5:53 PM

I think that the argument parsing should really be hoisted into the driver rather than pushed down into the assembler. The driver can parse and validate the options before passing them down, so when cc1as gets it, it will simply set the value.

The newly introduced diagnostics, especially right now, are not driver related. Nor are they common. I would say that we would need a DiagnosticAssemblerKind.td for these.

mgrang updated this revision to Diff 80314.Dec 5 2016, 1:06 PM
mgrang edited edge metadata.

Moved error checking up to the driver and added another test case.

compnerd accepted this revision.Dec 5 2016, 6:45 PM
compnerd edited edge metadata.

Im not the biggest fan of this. However, having some validation is probably better than not. We can come up with a better way to address this in the future when needed I suppose.

This revision is now accepted and ready to land.Dec 5 2016, 6:45 PM
This revision was automatically updated to reflect the committed changes.