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

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun May 31 16:23:24 PDT 2015


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



More information about the llvm-commits mailing list