[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 06:57:04 PDT 2017


errorToBool LGTM.

Cheers,
Rafael

Lang Hames <lhames at gmail.com> writes:

>>
>> How about just changing consumeError to return bool and the above becomes
>>
>
>
> return consumeError(ExpectedSomethig);
>
>
> This seems like a good idea to me, but please make it a new function and
> name it errorToBool: The name is clearer, and matches the scheme for the
> other error idiom conversion: errorToErrorCode.
>
> -- Lang.
>
> On Tue, Oct 31, 2017 at 12:21 AM, Rafael Avila de Espindola <
> rafael.espindola at gmail.com> wrote:
>
>> I think we need a convenience function that is the correct version of
>>
>> return bool(ExpectedSomethig);
>>
>> otherwise we have to inline the check everywhere. How about just
>> changing consumeError to return bool and the above becomes
>>
>> return consumeError(ExpectedSomethig);
>>
>> Cheers,
>> Rafael
>>
>> Nico Weber via Phabricator <reviews at reviews.llvm.org> writes:
>>
>> > thakis added a comment.
>> >
>> > https://reviews.llvm.org/rL315477, https://reviews.llvm.org/rL315475,
>> https://reviews.llvm.org/rL315474, https://reviews.llvm.org/rL315473,
>> https://reviews.llvm.org/rL315376, https://reviews.llvm.org/rL315354 seem
>> to not have introduced bugs of this type as far as I can tell.
>> >
>> >
>> > https://reviews.llvm.org/D39437
>>


More information about the llvm-commits mailing list