[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 10:24:31 PDT 2017


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.)

None of these would help with the 4th question. Which one do you want? To me it's not obvious which one will pan out best, so it feels a bit like premature abstraction to me. But happy to implement whatever you want, I just don't understand what it is yet.


https://reviews.llvm.org/D39437





More information about the llvm-commits mailing list