[lld] r240147 - [lld] Allow LLD passes to return error codes.

Lang Hames lhames at gmail.com
Fri Jun 19 14:24:29 PDT 2015

Hi Davide,

This was posted for review at http://reviews.llvm.org/D10552 and reviewed
by Rui, who Ok'd it. The approach was also verbally Ok'd by Nick Kledzik.

The phab review should have gone out to lld subscribers, but it doesn't
look like emails were sent to llvm-commits. That's odd, but I'm still
digesting Phabricator's interface, so I might have missed a tag somewhere.
I'll try to check next time I post a review.

Is there any reason not to return std::error_code from passes? It seems
reasonable that a pass may fail. The specific case I have in mind is TLV
relocation processing on MachO: If the OS version min is too low we want to
error out and report back to the user. This kind of use seems to have been
anticipated: The PassManager already returns an error code, although it was
always default constructed (no error), and not yet checked.

- Lang.

On Fri, Jun 19, 2015 at 1:02 PM, Davide Italiano <davide at freebsd.org> wrote:

> On Fri, Jun 19, 2015 at 10:51 AM, Lang Hames <lhames at gmail.com> wrote:
> > Author: lhames
> > Date: Fri Jun 19 12:51:46 2015
> > New Revision: 240147
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=240147&view=rev
> > Log:
> > [lld] Allow LLD passes to return error codes.
> >
> Hi Lang,
> this is a relatively large change. For the future it would be nice if
> we can discuss this before checking in (e.g. on llvm-devel).
> That said, do you have an use-case for this? In the past we explicitly
> tried to not change return type from 'void' to 'std::error_code' just
> in case.
> Thanks!
> --
> Davide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150619/5bb9eeaa/attachment.html>

More information about the llvm-commits mailing list