diff options
author | Bill Wendling <isanbard@gmail.com> | 2006-11-29 00:19:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2006-11-29 00:19:40 +0000 |
commit | afd54eb8b63025955fca8c184ab78f7ed75414f7 (patch) | |
tree | 9eaaabde78fe455487783cdf40a0bebcb0352b6c /llvm/lib/Analysis/IPA/CallGraph.cpp | |
parent | a531ac291cc4fb65f4d9573d08babf5ce8bd4a9d (diff) | |
download | bcm5719-llvm-afd54eb8b63025955fca8c184ab78f7ed75414f7.tar.gz bcm5719-llvm-afd54eb8b63025955fca8c184ab78f7ed75414f7.zip |
Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.
llvm-svn: 31990
Diffstat (limited to 'llvm/lib/Analysis/IPA/CallGraph.cpp')
-rw-r--r-- | llvm/lib/Analysis/IPA/CallGraph.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/IPA/CallGraph.cpp b/llvm/lib/Analysis/IPA/CallGraph.cpp index d9e7242695c..9c22b7cc5e2 100644 --- a/llvm/lib/Analysis/IPA/CallGraph.cpp +++ b/llvm/lib/Analysis/IPA/CallGraph.cpp @@ -16,7 +16,8 @@ #include "llvm/Module.h" #include "llvm/Instructions.h" #include "llvm/Support/CallSite.h" -#include <iostream> +#include "llvm/Support/Streams.h" +#include <ostream> using namespace llvm; static bool isOnlyADirectCall(Function *F, CallSite CS) { @@ -72,6 +73,10 @@ public: AU.setPreservesAll(); } + void print(llvm_ostream &o, const Module *M) const { + if (o.stream()) print(*o.stream(), M); + } + virtual void print(std::ostream &o, const Module *M) const { o << "CallGraph Root is: "; if (Function *F = getRoot()->getFunction()) @@ -89,7 +94,7 @@ public: /// dump - Print out this call graph. /// inline void dump() const { - print(std::cerr, Mod); + print(llvm_cerr, Mod); } CallGraphNode* getExternalCallingNode() const { return ExternalCallingNode; } @@ -207,7 +212,7 @@ void CallGraph::print(std::ostream &OS, const Module *M) const { } void CallGraph::dump() const { - print(std::cerr, 0); + print(llvm_cerr, 0); } //===----------------------------------------------------------------------===// @@ -270,7 +275,7 @@ void CallGraphNode::print(std::ostream &OS) const { OS << "\n"; } -void CallGraphNode::dump() const { print(std::cerr); } +void CallGraphNode::dump() const { print(llvm_cerr); } void CallGraphNode::removeCallEdgeTo(CallGraphNode *Callee) { for (unsigned i = CalledFunctions.size(); ; --i) { |