[llvm-dev] A question about the widely used "xxx | true" inside llvm

Chris Lattner via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 22 21:30:44 PDT 2018


On Aug 19, 2018, at 10:33 PM, Craig Topper via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> The language requires both sides of the | need to be evaluated. The compiler can't remove the function call if it has side effects.

Correct.  If you are somehow really bothered by this, we could also use:

bool bar() {
  return foo(), true;
}

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180822/30b1b148/attachment.html>


More information about the llvm-dev mailing list