[Mlir-commits] [mlir] a2a146b - [mlir] Remove unused local variables (NFC) (#163105)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Sun Oct 12 20:50:01 PDT 2025


Author: Kazu Hirata
Date: 2025-10-12T20:49:57-07:00
New Revision: a2a146b67c517aa324760d106ad0f44ddbe512e3

URL: https://github.com/llvm/llvm-project/commit/a2a146b67c517aa324760d106ad0f44ddbe512e3
DIFF: https://github.com/llvm/llvm-project/commit/a2a146b67c517aa324760d106ad0f44ddbe512e3.diff

LOG: [mlir] Remove unused local variables (NFC) (#163105)

Identified with bugprone-unused-local-non-trivial-variable.

Added: 
    

Modified: 
    mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp
    mlir/tools/mlir-tblgen/CppGenUtilities.cpp
    mlir/unittests/IR/RemarkTest.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp b/mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp
index e3f075fcc1294..8ecb08456da1a 100644
--- a/mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp
+++ b/mlir/lib/Target/IRDLToCpp/IRDLToCpp.cpp
@@ -464,12 +464,6 @@ static std::string generateOpDefinition(irdl::detail::dictionary &dict,
   auto opStrings = getStrings(op);
   fillDict(dict, opStrings);
 
-  const auto operandCount = opStrings.opOperandNames.size();
-  const auto operandNames =
-      operandCount ? joinNameList(opStrings.opOperandNames) : "{\"\"}";
-
-  const auto resultNames = joinNameList(opStrings.opResultNames);
-
   auto resultTypes = llvm::join(
       llvm::map_range(opStrings.opResultNames,
                       [](StringRef attr) -> std::string {

diff  --git a/mlir/tools/mlir-tblgen/CppGenUtilities.cpp b/mlir/tools/mlir-tblgen/CppGenUtilities.cpp
index fddd7790a4375..7cead353396dd 100644
--- a/mlir/tools/mlir-tblgen/CppGenUtilities.cpp
+++ b/mlir/tools/mlir-tblgen/CppGenUtilities.cpp
@@ -18,8 +18,6 @@ void mlir::tblgen::emitSummaryAndDescComments(llvm::raw_ostream &os,
                                               llvm::StringRef summary,
                                               llvm::StringRef description,
                                               bool terminateComment) {
-
-  std::string comments = "";
   StringRef trimmedSummary = summary.trim();
   StringRef trimmedDesc = description.trim();
   raw_indented_ostream ros(os);

diff  --git a/mlir/unittests/IR/RemarkTest.cpp b/mlir/unittests/IR/RemarkTest.cpp
index 5bfca255c22ca..bcbda90cf69cb 100644
--- a/mlir/unittests/IR/RemarkTest.cpp
+++ b/mlir/unittests/IR/RemarkTest.cpp
@@ -149,7 +149,6 @@ TEST(Remark, TestNoOutputOptimizationRemark) {
 
   std::string categoryFailName("myImportantCategory");
   std::string myPassname1("myPass1");
-  std::string funcName("myFunc");
   SmallString<64> tmpPathStorage;
   sys::fs::createUniquePath("remarks-%%%%%%.yaml", tmpPathStorage,
                             /*MakeAbsolute=*/true);
@@ -271,9 +270,6 @@ TEST(Remark, TestCustomOptimizationRemarkDiagnostic) {
   std::string categoryInline("Inliner");
   std::string myPassname1("myPass1");
   std::string myPassname2("myPass2");
-  std::string funcName("myFunc");
-
-  std::string seenMsg = "";
 
   {
     MLIRContext context;


        


More information about the Mlir-commits mailing list