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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index d9e7242..9c22b7c 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/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 @@
     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 @@
   /// 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::dump() const {
-  print(std::cerr, 0);
+  print(llvm_cerr, 0);
 }
 
 //===----------------------------------------------------------------------===//
@@ -270,7 +275,7 @@
   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) {