[all-commits] [llvm/llvm-project] ecbee4: [Builders.h] Silence a warning by adding a cast.

Chris Lattner via All-commits all-commits at lists.llvm.org
Sat Oct 16 13:30:41 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ecbee4804d44c0afdf97fe59e8221c30cbbf3ae7
      https://github.com/llvm/llvm-project/commit/ecbee4804d44c0afdf97fe59e8221c30cbbf3ae7
  Author: Chris Lattner <clattner at nondot.org>
  Date:   2021-10-16 (Sat, 16 Oct 2021)

  Changed paths:
    M mlir/include/mlir/IR/Builders.h

  Log Message:
  -----------
  [Builders.h] Silence a warning by adding a cast.

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);
    ^~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D111951




More information about the All-commits mailing list