diff options
| author | Chris Lattner <clattner@google.com> | 2018-12-28 08:48:09 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 14:43:13 -0700 |
| commit | 69d9e990facf4d07c31b96e47e98cde07228f229 (patch) | |
| tree | cf76ee03ebef0e449412063a04fd773dcf9c5115 /mlir/lib/Transforms/ViewFunctionGraph.cpp | |
| parent | f845bc4542719878d9d21d94eef96fb05a254913 (diff) | |
| download | bcm5719-llvm-69d9e990facf4d07c31b96e47e98cde07228f229.tar.gz bcm5719-llvm-69d9e990facf4d07c31b96e47e98cde07228f229.zip | |
Eliminate the using decls for MLFunction and CFGFunction standardizing on
Function.
This is step 18/n towards merging instructions and statements, NFC.
PiperOrigin-RevId: 227139399
Diffstat (limited to 'mlir/lib/Transforms/ViewFunctionGraph.cpp')
| -rw-r--r-- | mlir/lib/Transforms/ViewFunctionGraph.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mlir/lib/Transforms/ViewFunctionGraph.cpp b/mlir/lib/Transforms/ViewFunctionGraph.cpp index 9c1614acb95..2ce8af3613a 100644 --- a/mlir/lib/Transforms/ViewFunctionGraph.cpp +++ b/mlir/lib/Transforms/ViewFunctionGraph.cpp @@ -25,16 +25,15 @@ namespace llvm { // Specialize DOTGraphTraits to produce more readable output. template <> -struct llvm::DOTGraphTraits<const CFGFunction *> - : public DefaultDOTGraphTraits { +struct llvm::DOTGraphTraits<const Function *> : public DefaultDOTGraphTraits { using DefaultDOTGraphTraits::DefaultDOTGraphTraits; static std::string getNodeLabel(const BasicBlock *basicBlock, - const CFGFunction *); + const Function *); }; -std::string llvm::DOTGraphTraits<const CFGFunction *>::getNodeLabel( - const BasicBlock *basicBlock, const CFGFunction *) { +std::string llvm::DOTGraphTraits<const Function *>::getNodeLabel( + const BasicBlock *basicBlock, const Function *) { // Reuse the print output for the node labels. std::string outStreamStr; raw_string_ostream os(outStreamStr); @@ -57,19 +56,19 @@ std::string llvm::DOTGraphTraits<const CFGFunction *>::getNodeLabel( } // end namespace llvm -void mlir::viewGraph(const CFGFunction &function, const llvm::Twine &name, +void mlir::viewGraph(const Function &function, const llvm::Twine &name, bool shortNames, const llvm::Twine &title, llvm::GraphProgram::Name program) { llvm::ViewGraph(&function, name, shortNames, title, program); } llvm::raw_ostream &mlir::writeGraph(llvm::raw_ostream &os, - const CFGFunction *function, - bool shortNames, const llvm::Twine &title) { + const Function *function, bool shortNames, + const llvm::Twine &title) { return llvm::WriteGraph(os, function, shortNames, title); } -void mlir::CFGFunction::viewGraph() const { +void mlir::Function::viewGraph() const { ::mlir::viewGraph(*this, llvm::Twine("cfgfunc ") + getName().str()); } @@ -79,7 +78,7 @@ struct PrintCFGPass : public FunctionPass { const llvm::Twine &title = "") : FunctionPass(&PrintCFGPass::passID), os(os), shortNames(shortNames), title(title) {} - PassResult runOnCFGFunction(CFGFunction *function) override { + PassResult runOnCFGFunction(Function *function) override { mlir::writeGraph(os, function, shortNames, title); return success(); } |

