mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Reapply 55859. This doesn't change anything as
long as the callgraph is correct. It checks for wrong callgraphs more strictly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55894 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user