aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
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
commit2833fac27324b956cfb31be987652d2304d10761 (patch)
treeb8cd8a14b9cc4c337f78febb7fae922c23bcfc4e /lib/Analysis
parente8a81da98d5b7373734f0702493fe22883c3e0e2 (diff)
downloadexternal_llvm-2833fac27324b956cfb31be987652d2304d10761.zip
external_llvm-2833fac27324b956cfb31be987652d2304d10761.tar.gz
external_llvm-2833fac27324b956cfb31be987652d2304d10761.tar.bz2
Small PostDominatorTree improvements
* Do not SEGFAULT if tree entryNode() is NULL * Print function names in dotty printer git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DomPrinter.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/Analysis/DomPrinter.cpp b/lib/Analysis/DomPrinter.cpp
index f1b44d0..ebfba7e 100644
--- a/lib/Analysis/DomPrinter.cpp
+++ b/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";