summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-11-04 00:21:19 +0000
committerChris Lattner <sabre@nondot.org>2002-11-04 00:21:19 +0000
commitb9d55473b5f1fdf04c3c1ee261ce2416a87fdbbf (patch)
tree8273bc28ff13c840c3ab56ea92b851b3a1184fd4 /llvm/lib
parenta20fabc7ec4bc491be7351424d843ce20f3743fd (diff)
downloadbcm5719-llvm-b9d55473b5f1fdf04c3c1ee261ce2416a87fdbbf.tar.gz
bcm5719-llvm-b9d55473b5f1fdf04c3c1ee261ce2416a87fdbbf.zip
Allow the call graph to be called from analyze naturally with print implemented
llvm-svn: 4517
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/IPA/CallGraph.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp
index 5c4b5d81f7e..2c26f8dbb26 100644
--- a/llvm/lib/Analysis/IPA/CallGraph.cpp
+++ b/llvm/lib/Analysis/IPA/CallGraph.cpp
@@ -130,8 +130,7 @@ void CallGraph::destroy() {
FunctionMap.clear();
}
-
-void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) {
+static void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) {
if (CGN->getFunction())
o << "Call graph node for function: '"
<< CGN->getFunction()->getName() <<"'\n";
@@ -146,11 +145,11 @@ void WriteToOutput(const CallGraphNode *CGN, std::ostream &o) {
o << "\n";
}
-void WriteToOutput(const CallGraph &CG, std::ostream &o) {
- o << "CallGraph Root is:\n" << CG.getRoot();
+void CallGraph::print(std::ostream &o, const Module *M) const {
+ o << "CallGraph Root is:\n" << getRoot();
- for (CallGraph::const_iterator I = CG.begin(), E = CG.end(); I != E; ++I)
- o << I->second;
+ for (CallGraph::const_iterator I = begin(), E = end(); I != E; ++I)
+ WriteToOutput(I->second, o);
}
OpenPOWER on IntegriCloud