This is an archive of the discontinued LLVM Phabricator instance.

[Builders.h] Silence a warning by adding a cast.
ClosedPublic

Authored by lattner on Oct 16 2021, 1:01 PM.

Details

Summary

The no-result version of createOrFold calls 'tryFold' but
ignores the result since it doesn't matter what it produced.
Explicitly cast to void to silence this warning:

../llvm/mlir/include/mlir/IR/Builders.h:454:5: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result]

tryFold(op.getOperation(), unused);
^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~

Diff Detail

Event Timeline

lattner created this revision.Oct 16 2021, 1:01 PM
lattner requested review of this revision.Oct 16 2021, 1:01 PM
lattner accepted this revision.Oct 16 2021, 1:30 PM
This revision is now accepted and ready to land.Oct 16 2021, 1:30 PM
This revision was automatically updated to reflect the committed changes.