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

Rui Ueyama ruiu at google.com
Sun May 31 19:34:11 PDT 2015


The linker doesn't use error codes. All errors are fatal, and I think
that's not going to change. The expected use case of error codes is to use
this linker to link in-memory object files by passing command line options
and memory buffer references. I don't know about exact use cases yet.

I'll merge these categories together to make it simple. We can extend that
later of we have to in future.
2015/05/31 午後4:23 "Rafael Espíndola" <rafael.espindola at gmail.com>:

> On 31 May 2015 at 19:05, Rui Ueyama <ruiu at google.com> wrote:
> > ================
> > Comment at: COFF/Error.h:21
> > @@ +20,3 @@
> > +// Driver errors
> > +enum class DriverError { Success, InvalidOption };
> > +
> > ----------------
> > rafael wrote:
> >> I don't think you need Success. You can just use std::error_code(), no?
> > 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?
>
> I guess it depends on the common usage.
>
> The most common case I have seen so far is
>
> -----------------------------------------
> if (EC == SomeParticularErrorToIgnore)
>   return/continue;
>
> Report all other errors in an uniform way.
> ---------------------------
>
> If that is the case, yes, it is probably better to have coarse categories.
>
> Thanks,
> Rafael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150531/e32bac03/attachment.html>


More information about the llvm-commits mailing list