[PATCH] D39437: Fix a bunch of assert-on-invalid-bitcode regressions after 315483
Rafael Avila de Espindola via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 31 11:12:08 PDT 2017
Nico Weber via Phabricator <reviews at reviews.llvm.org> writes:
> thakis added a comment.
>
> I'm not subscribed to llvm-commits so replying here:
>
>> What happened to the errorToBool idea?
>
> Apologies I didn't see that suggestion (it's here: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20171030/498706.html) because it didn't make it to phab somehow. (Weren't email replies supposed to show up on phab?)
>
> errorToErrorCode() takes an error. The new function here would take an Expected, right? Do you want
>
> return expectedToBool(BCData);
>
> in the first two functions? If so, that wouldn't make the 3rd any shorter. If we had an errorToBool(), the first three would look like
>
> if (!BCData)
> return errorToBool(BCData.takeError());
>
> (followed by
>
> return true;
>
> in the first two.)
It could be just
errorToBool(BCData.takeError());
and errorToBool() can handle ErrorSuccess, no?
Cheers,
Rafael
More information about the llvm-commits
mailing list