diff options
author | Duncan Sands <baldrick@free.fr> | 2008-09-08 11:05:51 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-09-08 11:05:51 +0000 |
commit | 46911f12713adb757d359b497d4530f2cde08b06 (patch) | |
tree | ae49e21183a0a24da97417cb9d4533c2628f8f98 /llvm/lib/Analysis/IPA/CallGraph.cpp | |
parent | ca14c071752fdcdf5a431d6a35700db3f67953d9 (diff) | |
download | bcm5719-llvm-46911f12713adb757d359b497d4530f2cde08b06.tar.gz bcm5719-llvm-46911f12713adb757d359b497d4530f2cde08b06.zip |
Reapply 55859. This doesn't change anything as
long as the callgraph is correct. It checks
for wrong callgraphs more strictly.
llvm-svn: 55894
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index c8f25b07b8d..99848c83269 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -272,26 +272,20 @@ void CallGraphNode::print(std::ostream &OS) const { else OS << "Call graph node <<null function: 0x" << this << ">>:\n"; - for (const_iterator I = begin(), E = end(); I != E; ++I) + for (const_iterator I = begin(), E = end(); I != E; ++I) { if (I->second->getFunction()) - OS << " Calls function '" << I->second->getFunction()->getName() <<"'\n"; - else - OS << " Calls external node\n"; + OS << " Calls function '" << I->second->getFunction()->getName() << "'"; + else + OS << " Calls external node"; + if (I->first.getInstruction()) + OS << " from '" << *I->first.getInstruction() << "'"; + OS << "\n"; + } OS << "\n"; } void CallGraphNode::dump() const { print(cerr); } -void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) { - for (unsigned i = CalledFunctions.size(); ; --i) { - assert(i && "Cannot find callee to remove!"); - if (CalledFunctions[i-1].second == Callee) { - CalledFunctions.erase(CalledFunctions.begin()+i-1); - return; - } - } -} - /// removeCallEdgeFor - This method removes the edge in the node for the /// specified call site. Note that this method takes linear time, so it /// should be used sparingly. |