[Mlir-commits] [mlir] [mlir] Fix -Wextra-semi warnings in generated code (NFC) (PR #96981)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Jun 27 15:53:04 PDT 2024


https://github.com/akirchhoff-modular created https://github.com/llvm/llvm-project/pull/96981

While building a downstream project including `mlir-tblgen`-generated headers, I received some `-Wextra-semi` warnings.  Fix these in the generated code by removing the extra semicolon in the generator.

>From 4df810508c1792a96a692e4b0158fe884a0cc040 Mon Sep 17 00:00:00 2001
From: Alex Kirchhoff <akirchhoff at modular.com>
Date: Thu, 27 Jun 2024 15:45:29 -0700
Subject: [PATCH] [mlir] Fix -Wextra-semi warnings in generated code (NFC)

While building a downstream project including `mlir-tblgen`-generated
headers, I received some `-Wextra-semi` warnings.  Fix these in the
generated code by removing the extra semicolon in the generator.
---
 mlir/tools/mlir-tblgen/RewriterGen.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp
index b8a3d5b49938e..0d3b29cc94e84 100644
--- a/mlir/tools/mlir-tblgen/RewriterGen.cpp
+++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp
@@ -1117,7 +1117,7 @@ void PatternEmitter::emit(StringRef rewriteName) {
 
       os << "return ::mlir::success();\n";
     }
-    os << "};\n";
+    os << "}\n";
   }
   os << "};\n\n";
 }



More information about the Mlir-commits mailing list