diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-23 18:23:40 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-23 18:23:40 +0000 |
commit | 8c562540963b09fed16e4a8895fae472b39159d2 (patch) | |
tree | 9f83aa940c484c4a9add13fb37549489d2633023 /llvm/lib/Analysis/IPA | |
parent | 0367559786c3ec8596b6512812c9dd43c68373f2 (diff) | |
download | bcm5719-llvm-8c562540963b09fed16e4a8895fae472b39159d2.tar.gz bcm5719-llvm-8c562540963b09fed16e4a8895fae472b39159d2.zip |
fix callgraph dump to not print 0x0x1234 for nodes.
Add the instruction pointer value for debuggability.
We now get dump output that looks like this:
Call graph node for function: 'f1'<<0x1017086b0>> #uses=1
CS<0x1017046f8> calls external node
Call graph node for function: '_ZNSt6vectorIdSaIdEEC1EmRKdRKS0_'<<0x1017086f0>> #uses=1
CS<0x0> calls external node
Call graph node for function: 'f4'<<0x1017087a0>> #uses=1
CS<0x101708c88> calls function 'f3'
llvm-svn: 102194
Diffstat (limited to 'llvm/lib/Analysis/IPA')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index 62a4c31e3bd..2bde56d7188 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -244,14 +244,16 @@ void CallGraphNode::print(raw_ostream &OS) const { else OS << "Call graph node <<null function>>"; - OS << "<<0x" << this << ">> #uses=" << getNumReferences() << '\n'; + OS << "<<" << this << ">> #uses=" << getNumReferences() << '\n'; - for (const_iterator I = begin(), E = end(); I != E; ++I) + for (const_iterator I = begin(), E = end(); I != E; ++I) { + OS << " CS<" << I->first << "> calls "; if (Function *FI = I->second->getFunction()) - OS << " Calls function '" << FI->getName() <<"'\n"; - else - OS << " Calls external node\n"; - OS << "\n"; + OS << "function '" << FI->getName() <<"'\n"; + else + OS << "external node\n"; + } + OS << '\n'; } void CallGraphNode::dump() const { print(dbgs()); } |