diff options
| author | Davide Italiano <davide@freebsd.org> | 2017-04-24 17:48:44 +0000 |
|---|---|---|
| committer | Davide Italiano <davide@freebsd.org> | 2017-04-24 17:48:44 +0000 |
| commit | ebd77645cc1c309bd53c382cf462f59d94d0cc63 (patch) | |
| tree | 381a6f03e9297221ff2ec0baeee4d4af2eb7743e /llvm/lib | |
| parent | da949c1804acae801ac0241d7cac87bee1291a24 (diff) | |
| download | bcm5719-llvm-ebd77645cc1c309bd53c382cf462f59d94d0cc63.tar.gz bcm5719-llvm-ebd77645cc1c309bd53c382cf462f59d94d0cc63.zip | |
[DomPrinter] Add a way to programmatically dump a dot representation.
Differential Revision: https://reviews.llvm.org/D32145
llvm-svn: 301205
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/DomPrinter.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DomPrinter.cpp b/llvm/lib/Analysis/DomPrinter.cpp index 7acfb41500d..8abc0e7d0df 100644 --- a/llvm/lib/Analysis/DomPrinter.cpp +++ b/llvm/lib/Analysis/DomPrinter.cpp @@ -80,6 +80,22 @@ struct DOTGraphTraits<PostDominatorTree*> }; } +void DominatorTree::viewGraph(const Twine &Name, const Twine &Title) { +#ifndef NDEBUG + ViewGraph(this, Name, false, Title); +#else + errs() << "DomTree dump not available, build with DEBUG\n"; +#endif // NDEBUG +} + +void DominatorTree::viewGraph() { +#ifndef NDEBUG + this->viewGraph("domtree", "Dominator Tree for function"); +#else + errs() << "DomTree dump not available, build with DEBUG\n"; +#endif // NDEBUG +} + namespace { struct DominatorTreeWrapperPassAnalysisGraphTraits { static DominatorTree *getGraph(DominatorTreeWrapperPass *DTWP) { |

