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 | b31247a840ffac5d6b0b29c8690855ca678193ea (patch) | |
tree | 678f164bada20ca68b6f2461c058ddd0c8d233f3 /lib | |
parent | ad9b5f31eaa739940c9ec540cc231afb99343304 (diff) | |
download | external_llvm-b31247a840ffac5d6b0b29c8690855ca678193ea.zip external_llvm-b31247a840ffac5d6b0b29c8690855ca678193ea.tar.gz external_llvm-b31247a840ffac5d6b0b29c8690855ca678193ea.tar.bz2 |
Make the print output more useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8517 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/IPA/CallGraph.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp index 34475e1..980d119 100644 --- a/lib/Analysis/IPA/CallGraph.cpp +++ b/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); } |