From bb18bc555b33e38932affe6728f0c04271234e20 Mon Sep 17 00:00:00 2001 From: Jie Fu Date: Tue, 27 Feb 2024 10:37:17 +0800 Subject: [PATCH] [mlir] Fix -Wunused-but-set-variable in ModuleTranslation.cpp (NFC) mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1050:11: error: variable 'numConstantsHit' set but not used [-Werror,-Wunused-but-set-variable] int numConstantsHit = 0; ^ mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:1051:11: error: variable 'numConstantsErased' set but not used [-Werror,-Wunused-but-set-variable] int numConstantsErased = 0; ^ 2 errors generated. commit-id:617f6ab7 --- mlir/lib/Target/LLVMIR/ModuleTranslation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp index 7cffd7bd1fa43e..a11603a44dcd1c 100644 --- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp +++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp @@ -1047,8 +1047,8 @@ LogicalResult ModuleTranslation::convertGlobals() { if (Block *initializer = op.getInitializerBlock()) { llvm::IRBuilder<> builder(llvmModule->getContext()); - int numConstantsHit = 0; - int numConstantsErased = 0; + [[maybe_unused]] int numConstantsHit = 0; + [[maybe_unused]] int numConstantsErased = 0; DenseMap constantAggregateUseMap; for (auto &op : initializer->without_terminator()) {