[Mlir-commits] [mlir] 37f826a - [mlir][Interfaces] Fix -Wunused-function (#196314)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Thu May 7 06:27:14 PDT 2026
Author: Aiden Grossman
Date: 2026-05-07T06:27:08-07:00
New Revision: 37f826aa9efec572a812ec8ddaccae3267bf6cb5
URL: https://github.com/llvm/llvm-project/commit/37f826aa9efec572a812ec8ddaccae3267bf6cb5
DIFF: https://github.com/llvm/llvm-project/commit/37f826aa9efec572a812ec8ddaccae3267bf6cb5.diff
LOG: [mlir][Interfaces] Fix -Wunused-function (#196314)
These functions are only used inside assert statements, so mark them
[[maybe_unused]] to prevent -Wunused-function when they are used in a
non-asserts build.
Added:
Modified:
mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp b/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
index 6f02575767e8e..8a46762eb8e05 100644
--- a/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/ReifyValueBounds.cpp
@@ -18,7 +18,8 @@
using namespace mlir;
using namespace mlir::arith;
-static bool isIndexLikeType(Type type, ValueBoundsOptions options) {
+[[maybe_unused]] static bool isIndexLikeType(Type type,
+ ValueBoundsOptions options) {
return type.isIndex() || (options.allowIntegerType && type.isInteger());
}
diff --git a/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp b/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
index 02579673d2293..b2b33b7441c37 100644
--- a/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
+++ b/mlir/lib/Interfaces/ValueBoundsOpInterface.cpp
@@ -77,11 +77,12 @@ static std::optional<int64_t> getConstantIntValue(OpFoldResult ofr) {
return std::nullopt;
}
-static bool isIndexOrIntegerType(Type type) {
+[[maybe_unused]] static bool isIndexOrIntegerType(Type type) {
return type.isIndex() || type.isInteger();
}
-static bool isIndexLikeType(Type type, ValueBoundsOptions options) {
+[[maybe_unused]] static bool isIndexLikeType(Type type,
+ ValueBoundsOptions options) {
return type.isIndex() || (options.allowIntegerType && type.isInteger());
}
More information about the Mlir-commits
mailing list