[mlir] Provide defaults to make enabling dumping simpler
authorJacques Pienaar <jpienaar@google.com>
Tue, 2 Jun 2020 17:47:06 +0000 (10:47 -0700)
committerJacques Pienaar <jpienaar@google.com>
Tue, 2 Jun 2020 17:47:07 +0000 (10:47 -0700)
Differential Revision: https://reviews.llvm.org/D80818

mlir/include/mlir/Pass/PassManager.h

index be5c5d5..7b06cf0 100644 (file)
@@ -19,6 +19,7 @@
 
 namespace llvm {
 class Any;
+raw_ostream &errs();
 } // end namespace llvm
 
 namespace mlir {
@@ -221,9 +222,12 @@ public:
   ///   potential mutations were made.
   /// * 'out' corresponds to the stream to output the printed IR to.
   void enableIRPrinting(
-      std::function<bool(Pass *, Operation *)> shouldPrintBeforePass,
-      std::function<bool(Pass *, Operation *)> shouldPrintAfterPass,
-      bool printModuleScope, bool printAfterOnlyOnChange, raw_ostream &out);
+      std::function<bool(Pass *, Operation *)> shouldPrintBeforePass =
+          [](Pass *, Operation *) { return true; },
+      std::function<bool(Pass *, Operation *)> shouldPrintAfterPass =
+          [](Pass *, Operation *) { return true; },
+      bool printModuleScope = true, bool printAfterOnlyOnChange = true,
+      raw_ostream &out = llvm::errs());
 
   //===--------------------------------------------------------------------===//
   // Pass Timing