From 3d63d1a390f8e7f04b6cea09f03dff5d34a3289b Mon Sep 17 00:00:00 2001 From: Uday Bondhugula Date: Fri, 16 Jul 2021 10:15:00 +0530 Subject: [PATCH] [MILR][NFC] Silence clang-tidy warning in AffineOps.cpp Silence clang-tidy warning in AffineOps.cpp due to the inability to see through the typeswitch. NFC. Differential Revision: https://reviews.llvm.org/D106125 --- mlir/lib/Dialect/Affine/IR/AffineOps.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp index 370084d116c6ea..7a1e2078228066 100644 --- a/mlir/lib/Dialect/Affine/IR/AffineOps.cpp +++ b/mlir/lib/Dialect/Affine/IR/AffineOps.cpp @@ -107,9 +107,12 @@ static bool remainsLegalAfterInline(OpTy op, Region *src, Region *dest, /// Checks if an affine apply operation remains legal after inlining from `src` /// to `dest`. +// Use "unused attribute" marker to silence clang-tidy warning stemming from +// the inability to see through "llvm::TypeSwitch". template <> -bool remainsLegalAfterInline(AffineApplyOp op, Region *src, Region *dest, - const BlockAndValueMapping &mapping) { +bool LLVM_ATTRIBUTE_UNUSED +remainsLegalAfterInline(AffineApplyOp op, Region *src, Region *dest, + const BlockAndValueMapping &mapping) { // If it's a valid dimension, we need to check that it remains so. if (isValidDim(op.getResult(), src)) return remainsLegalAfterInline(