aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <clattner@nondot.org>2021-10-16 13:01:13 -0700
committerChris Lattner <clattner@nondot.org>2021-10-16 13:30:28 -0700
commitecbee4804d44c0afdf97fe59e8221c30cbbf3ae7 (patch)
tree043667fa8abd8501aeb63599b0abfd77947ce70c
parentd0d991cd23eff29737aae704d8b9611bd3416ec9 (diff)
downloadllvm-ecbee4804d44c0afdf97fe59e8221c30cbbf3ae7.zip
llvm-ecbee4804d44c0afdf97fe59e8221c30cbbf3ae7.tar.gz
llvm-ecbee4804d44c0afdf97fe59e8221c30cbbf3ae7.tar.bz2
[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
-rw-r--r--mlir/include/mlir/IR/Builders.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/mlir/include/mlir/IR/Builders.h b/mlir/include/mlir/IR/Builders.h
index e87796e..6a50bc7 100644
--- a/mlir/include/mlir/IR/Builders.h
+++ b/mlir/include/mlir/IR/Builders.h
@@ -451,7 +451,7 @@ public:
createOrFold(Location location, Args &&...args) {
auto op = create<OpTy>(location, std::forward<Args>(args)...);
SmallVector<Value, 0> unused;
- tryFold(op.getOperation(), unused);
+ (void)tryFold(op.getOperation(), unused);
// Folding cannot remove a zero-result operation, so for convenience we
// continue to return it.