diff --git a/mlir/tools/mlir-tblgen/RewriterGen.cpp b/mlir/tools/mlir-tblgen/RewriterGen.cpp --- a/mlir/tools/mlir-tblgen/RewriterGen.cpp +++ b/mlir/tools/mlir-tblgen/RewriterGen.cpp @@ -1028,12 +1028,8 @@ } // Emit function to add the generated matchers to the pattern list. - os << "void\n"; - os << "#if !defined(_MSC_VER) || defined(__clang__)\n"; - os << "__attribute__((unused))\n"; - os << "#endif\n"; - os << "populateWithGenerated(MLIRContext *context, " - << "OwningRewritePatternList *patterns) {\n"; + os << "void LLVM_ATTRIBUTE_UNUSED populateWithGenerated(MLIRContext " + "*context, OwningRewritePatternList *patterns) {\n"; for (const auto &name : rewriterNames) { os << " patterns->insert<" << name << ">(context);\n"; }