Removed #include <iostream> and used the llvm_cerr/DOUT streams instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31922 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp
index 7e1f5cc..af2928b 100644
--- a/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp
@@ -23,11 +23,10 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "RSProfiling.h"
 #include "ProfilingUtils.h"
-#include <iostream>
-
 using namespace llvm;
 
 namespace {
@@ -48,7 +47,7 @@
 bool FunctionProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert function profiling into a module"
+    llvm_cerr << "WARNING: cannot insert function profiling into a module"
               << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }
@@ -91,7 +90,7 @@
 bool BlockProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert block profiling into a module"
+    llvm_cerr << "WARNING: cannot insert block profiling into a module"
               << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }
diff --git a/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
index a94c42d..40a8faa 100644
--- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp
+++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
@@ -21,10 +21,10 @@
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
+#include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "ProfilingUtils.h"
-#include <iostream>
 #include <set>
 using namespace llvm;
 
@@ -42,7 +42,7 @@
 bool EdgeProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert edge profiling into a module"
+    llvm_cerr << "WARNING: cannot insert edge profiling into a module"
               << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp
index 671b3bc..4c6f264 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -45,13 +45,10 @@
 #include "llvm/Transforms/Instrumentation.h"
 //#include "ProfilingUtils.h"
 #include "RSProfiling.h"
-
 #include <set>
 #include <map>
 #include <queue>
 #include <list>
-#include <iostream>
-
 using namespace llvm;
 
 namespace {
@@ -628,7 +625,7 @@
   std::map<BasicBlock*, int> finish;
   int time = 0;
   recBackEdge(&F.getEntryBlock(), BackEdges, color, depth, finish, time);
-  DEBUG(std::cerr << F.getName() << " " << BackEdges.size() << "\n");
+  DOUT << F.getName() << " " << BackEdges.size() << "\n";
 }
 
 
diff --git a/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp b/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
index 003ea0d..076fa81 100644
--- a/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
+++ b/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
@@ -23,7 +23,6 @@
 #include "ProfilingUtils.h"
 #include "llvm/Support/Debug.h"
 #include <set>
-#include <iostream>
 using namespace llvm;
 
 namespace {
@@ -43,8 +42,8 @@
 static void InsertInstrumentationCall (BasicBlock *BB,
                                        const std::string FnName,
                                        unsigned BBNumber) {
-  DEBUG (std::cerr << "InsertInstrumentationCall (\"" << BB->getName ()
-                   << "\", \"" << FnName << "\", " << BBNumber << ")\n");
+  DOUT << "InsertInstrumentationCall (\"" << BB->getName ()
+       << "\", \"" << FnName << "\", " << BBNumber << ")\n";
   Module &M = *BB->getParent ()->getParent ();
   Function *InstrFn = M.getOrInsertFunction (FnName, Type::VoidTy,
                                              Type::UIntTy, (Type *)0);
@@ -62,7 +61,7 @@
 bool TraceBasicBlocks::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    std::cerr << "WARNING: cannot insert basic-block trace instrumentation"
+    llvm_cerr << "WARNING: cannot insert basic-block trace instrumentation"
               << " into a module with no main function!\n";
     return false;  // No main, no instrumentation!
   }