diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-15 04:29:37 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-15 04:29:37 +0000 |
commit | 5d0d3a2667c02d895ce40b25d3f262c33689898c (patch) | |
tree | 092918f81e5330356a71136aa2c27a970d710822 /llvm/lib/Analysis | |
parent | 5a6fa29eb398995cab25496701a650ce9459b216 (diff) | |
download | bcm5719-llvm-5d0d3a2667c02d895ce40b25d3f262c33689898c.tar.gz bcm5719-llvm-5d0d3a2667c02d895ce40b25d3f262c33689898c.zip |
Make the print output more useful
llvm-svn: 8517
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index 34475e18c99..980d11961e7 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -135,7 +135,7 @@ static void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) { o << "Call graph node for function: '" << CGN->getFunction()->getName() <<"'\n"; else - o << "Call graph node null function:\n"; + o << "Call graph node <<null function: 0x" << CGN << ">>:\n"; for (unsigned i = 0; i < CGN->size(); ++i) if ((*CGN)[i]->getFunction()) @@ -146,8 +146,12 @@ static void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) { } void CallGraph::print(std::ostream &o, const Module *M) const { - o << "CallGraph Root is:\n" << getRoot(); - + o << "CallGraph Root is: "; + if (getRoot()->getFunction()) + o << getRoot()->getFunction()->getName() << "\n"; + else + o << "<<null function: 0x" << getRoot() << ">>\n"; + for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I) WriteToOutput(I->second, o); } |