[Mlir-commits] [mlir] [mlir] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] (NFC) (PR #163917)

Kazu Hirata llvmlistbot at llvm.org
Thu Oct 16 23:41:48 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/163917

This patch replaces LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]],
introduced as part of C++17.


>From ebc53abe2cd9139814d010af31a26c92daccbeda Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 16 Oct 2025 07:24:48 -0700
Subject: [PATCH] [mlir] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]]
 (NFC)

This patch replaces LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]],
introduced as part of C++17.
---
 mlir/unittests/Dialect/SparseTensor/MergerTest.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/unittests/Dialect/SparseTensor/MergerTest.cpp b/mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
index 2a583059d2e0a..2b92e47d9288e 100644
--- a/mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
+++ b/mlir/unittests/Dialect/SparseTensor/MergerTest.cpp
@@ -141,7 +141,7 @@ class MergerTestBase : public ::testing::TestWithParam<LevelFormat> {
   }
 
 #define IMPL_BINOP_EXPR(OP, KIND)                                              \
-  LLVM_ATTRIBUTE_UNUSED ExprId OP##Expr(ExprId e0, ExprId e1) {                \
+  [[maybe_unused]] ExprId OP##Expr(ExprId e0, ExprId e1) {                     \
     return merger.addExp(KIND, e0, e1);                                        \
   }
   FOREVERY_BINOP(IMPL_BINOP_EXPR)



More information about the Mlir-commits mailing list