[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:32 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-mlir

Author: None (akirchhoff-modular)

<details>
<summary>Changes</summary>

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.

---
Full diff: https://github.com/llvm/llvm-project/pull/96981.diff


1 Files Affected:

- (modified) mlir/tools/mlir-tblgen/RewriterGen.cpp (+1-1) 


``````````diff
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";
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/96981


More information about the Mlir-commits mailing list