[mlir] Compilation fix: use LLVM_ATTRIBUTE_UNUSED following 6656e961c08393c3949412ef9...
authorAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 3 Jan 2020 21:31:24 +0000 (16:31 -0500)
committerAlexandre Ganea <alexandre.ganea@ubisoft.com>
Fri, 3 Jan 2020 21:31:33 +0000 (16:31 -0500)
Differential Revision: https://reviews.llvm.org/D72124

mlir/tools/mlir-tblgen/RewriterGen.cpp

index 1562562..92c2c79 100644 (file)
@@ -1028,12 +1028,8 @@ static void emitRewriters(const RecordKeeper &recordKeeper, raw_ostream &os) {
   }
 
   // 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";
   }