diff --git a/mlir/include/mlir/Transforms/Passes.h b/mlir/include/mlir/Transforms/Passes.h --- a/mlir/include/mlir/Transforms/Passes.h +++ b/mlir/include/mlir/Transforms/Passes.h @@ -60,7 +60,7 @@ /// Creates a pass which prints the list of ops and the number of occurrences in /// the module. -std::unique_ptr createPrintOpStatsPass(); +std::unique_ptr createPrintOpStatsPass(raw_ostream &os = llvm::errs()); /// Creates a pass which inlines calls and callable operations as defined by /// the CallGraph. diff --git a/mlir/lib/Transforms/OpStats.cpp b/mlir/lib/Transforms/OpStats.cpp --- a/mlir/lib/Transforms/OpStats.cpp +++ b/mlir/lib/Transforms/OpStats.cpp @@ -19,7 +19,7 @@ namespace { struct PrintOpStatsPass : public PrintOpStatsBase { - explicit PrintOpStatsPass(raw_ostream &os = llvm::errs()) : os(os) {} + explicit PrintOpStatsPass(raw_ostream &os) : os(os) {} // Prints the resultant operation statistics post iterating over the module. void runOnOperation() override; @@ -80,6 +80,6 @@ } } -std::unique_ptr mlir::createPrintOpStatsPass() { - return std::make_unique(); +std::unique_ptr mlir::createPrintOpStatsPass(raw_ostream &os) { + return std::make_unique(os); }