summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Transforms/ViewFunctionGraph.cpp
diff options
context:
space:
mode:
authorRiver Riddle <riverriddle@google.com>2019-02-27 10:59:29 -0800
committerjpienaar <jpienaar@google.com>2019-03-29 16:47:14 -0700
commitc6c534493d625c10ce0046baa9dc6293f8dba405 (patch)
tree87246fb531049bf478bb4b061217d11b8d7fe254 /mlir/lib/Transforms/ViewFunctionGraph.cpp
parent6067cdebaa391cb2ab9bda9cd91b26f9ddd95a11 (diff)
downloadbcm5719-llvm-c6c534493d625c10ce0046baa9dc6293f8dba405.tar.gz
bcm5719-llvm-c6c534493d625c10ce0046baa9dc6293f8dba405.zip
Port all of the existing passes over to the new pass manager infrastructure. This is largely NFC.
PiperOrigin-RevId: 235952357
Diffstat (limited to 'mlir/lib/Transforms/ViewFunctionGraph.cpp')
-rw-r--r--mlir/lib/Transforms/ViewFunctionGraph.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/mlir/lib/Transforms/ViewFunctionGraph.cpp b/mlir/lib/Transforms/ViewFunctionGraph.cpp
index 14e21770e25..30fae94139f 100644
--- a/mlir/lib/Transforms/ViewFunctionGraph.cpp
+++ b/mlir/lib/Transforms/ViewFunctionGraph.cpp
@@ -73,18 +73,15 @@ void mlir::Function::viewGraph() const {
}
namespace {
-struct PrintCFGPass : public FunctionPass {
+struct PrintCFGPass : public FunctionPass<PrintCFGPass> {
PrintCFGPass(llvm::raw_ostream &os = llvm::errs(), bool shortNames = false,
const llvm::Twine &title = "")
- : FunctionPass(&PrintCFGPass::passID), os(os), shortNames(shortNames),
- title(title) {}
- PassResult runOnFunction(Function *function) override {
- mlir::writeGraph(os, function, shortNames, title);
+ : os(os), shortNames(shortNames), title(title) {}
+ PassResult runOnFunction() {
+ mlir::writeGraph(os, &getFunction(), shortNames, title);
return success();
}
- constexpr static PassID passID = {};
-
private:
llvm::raw_ostream &os;
bool shortNames;
@@ -92,9 +89,9 @@ private:
};
} // namespace
-FunctionPass *mlir::createPrintCFGGraphPass(llvm::raw_ostream &os,
- bool shortNames,
- const llvm::Twine &title) {
+FunctionPassBase *mlir::createPrintCFGGraphPass(llvm::raw_ostream &os,
+ bool shortNames,
+ const llvm::Twine &title) {
return new PrintCFGPass(os, shortNames, title);
}
OpenPOWER on IntegriCloud