Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

akirchhoff-modular
Copy link
Contributor

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.

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.
@llvmbot llvmbot added mlir:core MLIR Core Infrastructure mlir labels Jun 27, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 27, 2024

@llvm/pr-subscribers-mlir-core

@llvm/pr-subscribers-mlir

Author: None (akirchhoff-modular)

Changes

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

@naibaf7 naibaf7 self-requested a review June 27, 2024 22:55
@akirchhoff-modular akirchhoff-modular merged commit 7d6de19 into llvm:main Jun 27, 2024
7 of 9 checks passed
@akirchhoff-modular akirchhoff-modular deleted the akirchhoff/mlir-fix-extra-semi branch June 27, 2024 22:57
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mlir:core MLIR Core Infrastructure mlir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants