[PATCH] D39437: Fix a bunch of assert-on-invalid-bitcode regressions after 315483

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 11:35:25 PDT 2017


thakis added a comment.

> It could be just
> 
>   errorToBool(BCData.takeError());
>    
> 
> and errorToBool() can handle ErrorSuccess, no?

Ah! And then errorToBool() would return true for error or for non-error? I.e. should isBitcodeFile() end in

  return errorToBool(BCData.takeError());

or

  return !errorToBool(BCData.takeError());

It's not clear to me from the name errorToBool() if true should mean "all good" or "it's an error". The name sounds like the latter, but then all of its current callers will return its result negated.


https://reviews.llvm.org/D39437





More information about the llvm-commits mailing list