Add an __attribute__((unused)) to populateWithGenerated since it might
authorEric Christopher <echristo@gmail.com>
Fri, 27 Dec 2019 02:48:59 +0000 (18:48 -0800)
committerEric Christopher <echristo@gmail.com>
Fri, 27 Dec 2019 02:48:59 +0000 (18:48 -0800)
not be used where defined and is autogenerated.

mlir/tools/mlir-tblgen/RewriterGen.cpp

index 824ddae..2fe26fe 100644 (file)
@@ -1020,7 +1020,8 @@ static void emitRewriters(const RecordKeeper &recordKeeper, raw_ostream &os) {
   }
 
   // Emit function to add the generated matchers to the pattern list.
-  os << "void populateWithGenerated(MLIRContext *context, "
+  os << "void __attribute__((unused)) populateWithGenerated(MLIRContext "
+        "*context, "
      << "OwningRewritePatternList *patterns) {\n";
   for (const auto &name : rewriterNames) {
     os << "  patterns->insert<" << name << ">(context);\n";