[llvm-dev] [RFC] Error handling in LLVM libraries.
Lang Hames via llvm-dev
llvm-dev at lists.llvm.org
Tue Feb 23 12:07:44 PST 2016
Hi Michael, Rafael, Pawel,
Apologies for the delayed reply - I was out on vacation last week.
> In fact I would actually support outright
> replacing ErrorOr with this if it can be done safely, as I find the
> name TypedErrorOr a bit long.
I find the name awkward too. I'll leave these classes as TypedError and
TypedErrorOr<T> when I submit the initial patch to llvm-commits, but please
feel free to comment on the names in that review. If the proposal is
adopted I think the eventual plan should be to move to 'Error' and
'ErrorOr<T>', or Error and Expected<T> (Pawel - I really like that
suggestion - thanks!).
> The main differences are
> * This will hopefully be used.
> * TypedErrorOr is really a TypedError or T. The situation before was not
that ErrorOr was std::error_code or T.
I don't follow that second point. As I see it, TypedErrorOr<T> and
ErrorOr<T> are identical except for two points: TypedError replaces
std::error_code, and as a consequence TypedErrorOr is only movable, not
On Thu, Feb 18, 2016 at 7:40 AM, Paweł Bylica <llvm-dev at lists.llvm.org>
> On Thu, Feb 18, 2016 at 4:36 PM Rafael Espíndola <llvm-dev at lists.llvm.org>
>> > I like this idea in general. It's a better implementation of what
>> > ErrorOr originally was before we removed the custom error support
>> > because it wasn't used. In fact I would actually support outright
>> > replacing ErrorOr with this if it can be done safely, as I find the
>> > name TypedErrorOr a bit long.
>> The main differences are
>> * This will hopefully be used.
>> * TypedErrorOr is really a TypedError or T. The situation before was
>> not that ErrorOr was std::error_code or T.
>> Since we are adding it, I would also support replacing every use of
>> ErrorOr with TypedErrorOr and renaming it.
> Alternative name could be Expected<T> as proposed by Andrei Alexandrescu.
>> LLVM Developers mailing list
>> llvm-dev at lists.llvm.org
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev