aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-09-15 04:29:37 +0000
committerChris Lattner <sabre@nondot.org>2003-09-15 04:29:37 +0000
commitb31247a840ffac5d6b0b29c8690855ca678193ea (patch)
tree678f164bada20ca68b6f2461c058ddd0c8d233f3 /lib
parentad9b5f31eaa739940c9ec540cc231afb99343304 (diff)
downloadexternal_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.cpp10
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);
}