Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/ExprTypeConvert.cpp b/lib/Transforms/ExprTypeConvert.cpp
index 39f21ea..1ce6eed 100644
--- a/lib/Transforms/ExprTypeConvert.cpp
+++ b/lib/Transforms/ExprTypeConvert.cpp
@@ -693,8 +693,8 @@
   I->setName("");
   Instruction *Res;     // Result of conversion
 
-  //llvm_cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
-  //          << "BB Before: " << BB << endl;
+  //cerr << endl << endl << "Type:\t" << Ty << "\nInst: " << I
+  //     << "BB Before: " << BB << endl;
 
   // Prevent I from being removed...
   ValueHandle IHandle(VMC, I);
diff --git a/lib/Transforms/Hello/Hello.cpp b/lib/Transforms/Hello/Hello.cpp
index 8324cbb..0b0010d 100644
--- a/lib/Transforms/Hello/Hello.cpp
+++ b/lib/Transforms/Hello/Hello.cpp
@@ -30,7 +30,7 @@
       HelloCounter++;
       std::string fname = F.getName();
       EscapeString(fname);
-      llvm_cerr << "Hello: " << fname << "\n";
+      cerr << "Hello: " << fname << "\n";
       return false;
     }
   };
@@ -43,7 +43,7 @@
       HelloCounter++;
       std::string fname = F.getName();
       EscapeString(fname);
-      llvm_cerr << "Hello: " << fname << "\n";
+      cerr << "Hello: " << fname << "\n";
       return false;
     }
 
diff --git a/lib/Transforms/IPO/GlobalOpt.cpp b/lib/Transforms/IPO/GlobalOpt.cpp
index a0dc937..764205b 100644
--- a/lib/Transforms/IPO/GlobalOpt.cpp
+++ b/lib/Transforms/IPO/GlobalOpt.cpp
@@ -494,17 +494,17 @@
       // Will trap.
     } else if (StoreInst *SI = dyn_cast<StoreInst>(*UI)) {
       if (SI->getOperand(0) == V) {
-        //llvm_cerr << "NONTRAPPING USE: " << **UI;
+        //cerr << "NONTRAPPING USE: " << **UI;
         return false;  // Storing the value.
       }
     } else if (CallInst *CI = dyn_cast<CallInst>(*UI)) {
       if (CI->getOperand(0) != V) {
-        //llvm_cerr << "NONTRAPPING USE: " << **UI;
+        //cerr << "NONTRAPPING USE: " << **UI;
         return false;  // Not calling the ptr
       }
     } else if (InvokeInst *II = dyn_cast<InvokeInst>(*UI)) {
       if (II->getOperand(0) != V) {
-        //llvm_cerr << "NONTRAPPING USE: " << **UI;
+        //cerr << "NONTRAPPING USE: " << **UI;
         return false;  // Not calling the ptr
       }
     } else if (CastInst *CI = dyn_cast<CastInst>(*UI)) {
@@ -515,7 +515,7 @@
                isa<ConstantPointerNull>(UI->getOperand(1))) {
       // Ignore setcc X, null
     } else {
-      //llvm_cerr << "NONTRAPPING USE: " << **UI;
+      //cerr << "NONTRAPPING USE: " << **UI;
       return false;
     }
   return true;
@@ -533,7 +533,7 @@
       // Ignore stores to the global.
     } else {
       // We don't know or understand this user, bail out.
-      //llvm_cerr << "UNKNOWN USER OF GLOBAL!: " << **UI;
+      //cerr << "UNKNOWN USER OF GLOBAL!: " << **UI;
       return false;
     }
 
@@ -1206,25 +1206,25 @@
 
   if (!AnalyzeGlobal(GV, GS, PHIUsers)) {
 #if 0
-    llvm_cerr << "Global: " << *GV;
-    llvm_cerr << "  isLoaded = " << GS.isLoaded << "\n";
-    llvm_cerr << "  StoredType = ";
+    cerr << "Global: " << *GV;
+    cerr << "  isLoaded = " << GS.isLoaded << "\n";
+    cerr << "  StoredType = ";
     switch (GS.StoredType) {
-    case GlobalStatus::NotStored: llvm_cerr << "NEVER STORED\n"; break;
-    case GlobalStatus::isInitializerStored: llvm_cerr << "INIT STORED\n"; break;
-    case GlobalStatus::isStoredOnce: llvm_cerr << "STORED ONCE\n"; break;
-    case GlobalStatus::isStored: llvm_cerr << "stored\n"; break;
+    case GlobalStatus::NotStored: cerr << "NEVER STORED\n"; break;
+    case GlobalStatus::isInitializerStored: cerr << "INIT STORED\n"; break;
+    case GlobalStatus::isStoredOnce: cerr << "STORED ONCE\n"; break;
+    case GlobalStatus::isStored: cerr << "stored\n"; break;
     }
     if (GS.StoredType == GlobalStatus::isStoredOnce && GS.StoredOnceValue)
-      llvm_cerr << "  StoredOnceValue = " << *GS.StoredOnceValue << "\n";
+      cerr << "  StoredOnceValue = " << *GS.StoredOnceValue << "\n";
     if (GS.AccessingFunction && !GS.HasMultipleAccessingFunctions)
-      llvm_cerr << "  AccessingFunction = " << GS.AccessingFunction->getName()
+      cerr << "  AccessingFunction = " << GS.AccessingFunction->getName()
                 << "\n";
-    llvm_cerr << "  HasMultipleAccessingFunctions =  "
+    cerr << "  HasMultipleAccessingFunctions =  "
               << GS.HasMultipleAccessingFunctions << "\n";
-    llvm_cerr << "  HasNonInstructionUser = " << GS.HasNonInstructionUser<<"\n";
-    llvm_cerr << "  isNotSuitableForSRA = " << GS.isNotSuitableForSRA << "\n";
-    llvm_cerr << "\n";
+    cerr << "  HasNonInstructionUser = " << GS.HasNonInstructionUser<<"\n";
+    cerr << "  isNotSuitableForSRA = " << GS.isNotSuitableForSRA << "\n";
+    cerr << "\n";
 #endif
     
     // If this is a first class global and has only one accessing function
diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp
index 3e7dcc6..f43a27f 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -74,8 +74,7 @@
   // Load the APIFile...
   std::ifstream In(Filename);
   if (!In.good()) {
-    llvm_cerr << "WARNING: Internalize couldn't load file '" << Filename
-              << "'!\n";
+    cerr << "WARNING: Internalize couldn't load file '" << Filename << "'!\n";
     return;   // Do not internalize anything...
   }
   while (In) {
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp
index af2928b..af438f9 100644
--- a/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp
@@ -47,8 +47,8 @@
 bool FunctionProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    llvm_cerr << "WARNING: cannot insert function profiling into a module"
-              << " with no main function!\n";
+    cerr << "WARNING: cannot insert function profiling into a module"
+         << " with no main function!\n";
     return false;  // No main, no instrumentation!
   }
 
@@ -90,8 +90,8 @@
 bool BlockProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    llvm_cerr << "WARNING: cannot insert block profiling into a module"
-              << " with no main function!\n";
+    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 40a8faa..36cf3e9 100644
--- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp
+++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
@@ -17,6 +17,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "ProfilingUtils.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
@@ -24,7 +25,6 @@
 #include "llvm/Support/Streams.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Instrumentation.h"
-#include "ProfilingUtils.h"
 #include <set>
 using namespace llvm;
 
@@ -42,8 +42,8 @@
 bool EdgeProfiler::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    llvm_cerr << "WARNING: cannot insert edge profiling into a module"
-              << " with no main function!\n";
+    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/TraceBasicBlocks.cpp b/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
index 076fa81..10b3641 100644
--- a/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
+++ b/lib/Transforms/Instrumentation/TraceBasicBlocks.cpp
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "ProfilingUtils.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Module.h"
@@ -20,7 +21,6 @@
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Instrumentation.h"
 #include "llvm/Instructions.h"
-#include "ProfilingUtils.h"
 #include "llvm/Support/Debug.h"
 #include <set>
 using namespace llvm;
@@ -61,8 +61,8 @@
 bool TraceBasicBlocks::runOnModule(Module &M) {
   Function *Main = M.getMainFunction();
   if (Main == 0) {
-    llvm_cerr << "WARNING: cannot insert basic-block trace instrumentation"
-              << " into a module with no main function!\n";
+    cerr << "WARNING: cannot insert basic-block trace instrumentation"
+         << " into a module with no main function!\n";
     return false;  // No main, no instrumentation!
   }
 
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 5073bde..4c0bbf4 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -7018,8 +7018,8 @@
   // If we are removing arguments to the function, emit an obnoxious warning...
   if (FT->getNumParams() < NumActualArgs)
     if (!FT->isVarArg()) {
-      llvm_cerr << "WARNING: While resolving call to function '"
-                << Callee->getName() << "' arguments were dropped!\n";
+      cerr << "WARNING: While resolving call to function '"
+           << Callee->getName() << "' arguments were dropped!\n";
     } else {
       // Add all of the arguments in their promoted form to the arg list...
       for (unsigned i = FT->getNumParams(); i != NumActualArgs; ++i, ++AI) {
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index a262cf7..66b595f 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@ -507,12 +507,12 @@
 }
 
 void BasedUser::dump() const {
-  llvm_cerr << " Base=" << *Base;
-  llvm_cerr << " Imm=" << *Imm;
+  cerr << " Base=" << *Base;
+  cerr << " Imm=" << *Imm;
   if (EmittedBase)
-    llvm_cerr << "  EB=" << *EmittedBase;
+    cerr << "  EB=" << *EmittedBase;
 
-  llvm_cerr << "   Inst: " << *Inst;
+  cerr << "   Inst: " << *Inst;
 }
 
 Value *BasedUser::InsertCodeForBaseAtPosition(const SCEVHandle &NewBase, 
diff --git a/lib/Transforms/Scalar/LowerPacked.cpp b/lib/Transforms/Scalar/LowerPacked.cpp
index f02c40f..25de5fb 100644
--- a/lib/Transforms/Scalar/LowerPacked.cpp
+++ b/lib/Transforms/Scalar/LowerPacked.cpp
@@ -73,8 +73,7 @@
    /// @param I the unhandled instruction
    void visitInstruction(Instruction &I) {
      if (isa<PackedType>(I.getType()))
-       llvm_cerr << "Unhandled Instruction with Packed ReturnType: "
-                 << I << '\n';
+       cerr << "Unhandled Instruction with Packed ReturnType: " << I << '\n';
    }
 private:
    /// @brief Retrieves lowered values for a packed value.
diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp
index a5f7db8..5d928c1 100644
--- a/lib/Transforms/Scalar/SCCP.cpp
+++ b/lib/Transforms/Scalar/SCCP.cpp
@@ -350,7 +350,7 @@
 
   void visitInstruction(Instruction &I) {
     // If a new instruction is added to LLVM that we don't handle...
-    llvm_cerr << "SCCP: Don't know how to handle: " << I;
+    cerr << "SCCP: Don't know how to handle: " << I;
     markOverdefined(&I);   // Just in case
   }
 };
@@ -400,7 +400,7 @@
       Succs[0] = true;
     }
   } else {
-    llvm_cerr << "SCCP: Don't know how to handle: " << TI;
+    cerr << "SCCP: Don't know how to handle: " << TI;
     Succs.assign(TI.getNumSuccessors(), true);
   }
 }
@@ -459,7 +459,7 @@
     }
     return false;
   } else {
-    llvm_cerr << "Unknown terminator instruction: " << *TI;
+    cerr << "Unknown terminator instruction: " << *TI;
     abort();
   }
 }
diff --git a/lib/Transforms/Utils/CodeExtractor.cpp b/lib/Transforms/Utils/CodeExtractor.cpp
index 52d53d5..a63e4e0 100644
--- a/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/lib/Transforms/Utils/CodeExtractor.cpp
@@ -699,10 +699,10 @@
           }
     }
 
-  //llvm_cerr << "NEW FUNCTION: " << *newFunction;
+  //cerr << "NEW FUNCTION: " << *newFunction;
   //  verifyFunction(*newFunction);
 
-  //  llvm_cerr << "OLD FUNCTION: " << *oldFunction;
+  //  cerr << "OLD FUNCTION: " << *oldFunction;
   //  verifyFunction(*oldFunction);
 
   DEBUG(if (verifyFunction(*newFunction)) abort());
diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp
index 4ad12b9..2adfb3e 100644
--- a/lib/Transforms/Utils/LowerSwitch.cpp
+++ b/lib/Transforms/Utils/LowerSwitch.cpp
@@ -96,8 +96,7 @@
 
 // operator<< - Used for debugging purposes.
 //
-llvm_ostream& operator<<(llvm_ostream &O,
-                         const std::vector<LowerSwitch::Case> &C) {
+OStream& operator<<(OStream &O, const std::vector<LowerSwitch::Case> &C) {
   O << "[";
 
   for (std::vector<LowerSwitch::Case>::const_iterator B = C.begin(),