summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2009-11-30 12:06:37 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2009-11-30 12:06:37 +0000
commitf7495f497a1b9346a4d069c16b7560cd1625c1a9 (patch)
treeb7237da71012bd52d437219d41927d517486373a /llvm/lib
parent5f0988ceb02d86e25477f26be0d71d9d458e2df1 (diff)
downloadbcm5719-llvm-f7495f497a1b9346a4d069c16b7560cd1625c1a9.tar.gz
bcm5719-llvm-f7495f497a1b9346a4d069c16b7560cd1625c1a9.zip
Small PostDominatorTree improvements
* Do not SEGFAULT if tree entryNode() is NULL * Print function names in dotty printer llvm-svn: 90130
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/DomPrinter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DomPrinter.cpp b/llvm/lib/Analysis/DomPrinter.cpp
index f1b44d0356e..ebfba7ef0f6 100644
--- a/llvm/lib/Analysis/DomPrinter.cpp
+++ b/llvm/lib/Analysis/DomPrinter.cpp
@@ -85,9 +85,11 @@ struct GenericGraphViewer : public FunctionPass {
virtual bool runOnFunction(Function &F) {
Analysis *Graph;
-
+ std::string Title, GraphName;
Graph = &getAnalysis<Analysis>();
- ViewGraph(Graph, Name, OnlyBBS);
+ GraphName = DOTGraphTraits<Analysis*>::getGraphName(Graph);
+ Title = GraphName + " for '" + F.getNameStr() + "' function";
+ ViewGraph(Graph, Name, OnlyBBS, Title);
return false;
}
@@ -163,8 +165,12 @@ struct GenericGraphPrinter : public FunctionPass {
raw_fd_ostream File(Filename.c_str(), ErrorInfo);
Graph = &getAnalysis<Analysis>();
+ std::string Title, GraphName;
+ GraphName = DOTGraphTraits<Analysis*>::getGraphName(Graph);
+ Title = GraphName + " for '" + F.getNameStr() + "' function";
+
if (ErrorInfo.empty())
- WriteGraph(File, Graph, OnlyBBS);
+ WriteGraph(File, Graph, OnlyBBS, Name, Title);
else
errs() << " error opening file for writing!";
errs() << "\n";
OpenPOWER on IntegriCloud