Change the return type of createPrintCFGGraphPass to match other passes.
authorJing Pu <jingpu@google.com>
Thu, 26 Sep 2019 01:33:09 +0000 (18:33 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Thu, 26 Sep 2019 01:33:47 +0000 (18:33 -0700)
PiperOrigin-RevId: 271252404

mlir/include/mlir/Transforms/ViewRegionGraph.h
mlir/lib/Transforms/ViewRegionGraph.cpp

index 626afc3..57fe1d3 100644 (file)
@@ -41,7 +41,7 @@ llvm::raw_ostream &writeGraph(llvm::raw_ostream &os, Region &region,
                               bool shortNames = false, const Twine &title = "");
 
 /// Creates a pass to print CFG graphs.
-OpPassBase<FuncOp> *
+std::unique_ptr<mlir::OpPassBase<mlir::FuncOp>>
 createPrintCFGGraphPass(llvm::raw_ostream &os = llvm::errs(),
                         bool shortNames = false, const llvm::Twine &title = "");
 
index 2861112..57c2f31 100644 (file)
@@ -85,10 +85,10 @@ private:
 };
 } // namespace
 
-OpPassBase<FuncOp> *mlir::createPrintCFGGraphPass(llvm::raw_ostream &os,
-                                                  bool shortNames,
-                                                  const llvm::Twine &title) {
-  return new PrintCFGPass(os, shortNames, title);
+std::unique_ptr<mlir::OpPassBase<mlir::FuncOp>>
+mlir::createPrintCFGGraphPass(llvm::raw_ostream &os, bool shortNames,
+                              const llvm::Twine &title) {
+  return std::make_unique<PrintCFGPass>(os, shortNames, title);
 }
 
 static PassRegistration<PrintCFGPass> pass("print-cfg-graph",