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/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp
index 0ec66ba..8a19739 100644
--- a/tools/bugpoint/OptimizerDriver.cpp
+++ b/tools/bugpoint/OptimizerDriver.cpp
@@ -56,7 +56,7 @@
   std::ofstream Out(Filename.c_str(), io_mode);
   if (!Out.good()) return true;
   try {
-    llvm_ostream L(Out);
+    OStream L(Out);
     WriteBytecodeToFile(M ? M : Program, L, /*compression=*/true);
   } catch (...) {
     return true;
@@ -74,15 +74,15 @@
   //
   std::string Filename = "bugpoint-" + ID + ".bc";
   if (writeProgramToFile(Filename)) {
-    llvm_cerr <<  "Error opening file '" << Filename << "' for writing!\n";
+    cerr <<  "Error opening file '" << Filename << "' for writing!\n";
     return;
   }
 
-  llvm_cout << "Emitted bytecode to '" << Filename << "'\n";
+  cout << "Emitted bytecode to '" << Filename << "'\n";
   if (NoFlyer || PassesToRun.empty()) return;
-  llvm_cout << "\n*** You can reproduce the problem with: ";
-  llvm_cout << "opt " << Filename << " ";
-  llvm_cout << getPassesString(PassesToRun) << "\n";
+  cout << "\n*** You can reproduce the problem with: ";
+  cout << "opt " << Filename << " ";
+  cout << getPassesString(PassesToRun) << "\n";
 }
 
 int BugDriver::runPassesAsChild(const std::vector<const PassInfo*> &Passes) {
@@ -91,7 +91,7 @@
                                std::ios::binary;
   std::ofstream OutFile(ChildOutput.c_str(), io_mode);
   if (!OutFile.good()) {
-    llvm_cerr << "Error opening bytecode file: " << ChildOutput << "\n";
+    cerr << "Error opening bytecode file: " << ChildOutput << "\n";
     return 1;
   }
 
@@ -103,14 +103,13 @@
     if (Passes[i]->getNormalCtor())
       PM.add(Passes[i]->getNormalCtor()());
     else
-      llvm_cerr << "Cannot create pass yet: " << Passes[i]->getPassName()
-                << "\n";
+      cerr << "Cannot create pass yet: " << Passes[i]->getPassName() << "\n";
   }
   // Check that the module is well formed on completion of optimization
   PM.add(createVerifierPass());
 
   // Write bytecode out to disk as the last step...
-  llvm_ostream L(OutFile);
+  OStream L(OutFile);
   PM.add(new WriteBytecodePass(&L));
 
   // Run all queued passes.
@@ -131,12 +130,12 @@
                           std::string &OutputFilename, bool DeleteOutput,
                           bool Quiet) const {
   // setup the output file name
-  llvm_cout << std::flush;
+  cout << std::flush;
   sys::Path uniqueFilename("bugpoint-output.bc");
   std::string ErrMsg;
   if (uniqueFilename.makeUnique(true, &ErrMsg)) {
-    llvm_cerr << getToolName() << ": Error making unique filename: " 
-              << ErrMsg << "\n";
+    cerr << getToolName() << ": Error making unique filename: " 
+         << ErrMsg << "\n";
     return(1);
   }
   OutputFilename = uniqueFilename.toString();
@@ -144,18 +143,18 @@
   // set up the input file name
   sys::Path inputFilename("bugpoint-input.bc");
   if (inputFilename.makeUnique(true, &ErrMsg)) {
-    llvm_cerr << getToolName() << ": Error making unique filename: " 
-              << ErrMsg << "\n";
+    cerr << getToolName() << ": Error making unique filename: " 
+         << ErrMsg << "\n";
     return(1);
   }
   std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
                                std::ios::binary;
   std::ofstream InFile(inputFilename.c_str(), io_mode);
   if (!InFile.good()) {
-    llvm_cerr << "Error opening bytecode file: " << inputFilename << "\n";
+    cerr << "Error opening bytecode file: " << inputFilename << "\n";
     return(1);
   }
-  llvm_ostream L(InFile);
+  OStream L(InFile);
   WriteBytecodeToFile(Program,L,false);
   InFile.close();
 
@@ -207,17 +206,17 @@
 
   if (!Quiet) {
     if (result == 0)
-      llvm_cout << "Success!\n";
+      cout << "Success!\n";
     else if (result > 0)
-      llvm_cout << "Exited with error code '" << result << "'\n";
+      cout << "Exited with error code '" << result << "'\n";
     else if (result < 0) {
       if (result == -1)
-        llvm_cout << "Execute failed: " << ErrMsg << "\n";
+        cout << "Execute failed: " << ErrMsg << "\n";
       else
-        llvm_cout << "Crashed with signal #" << abs(result) << "\n";
+        cout << "Crashed with signal #" << abs(result) << "\n";
     }
     if (result & 0x01000000)
-      llvm_cout << "Dumped core\n";
+      cout << "Dumped core\n";
   }
 
   // Was the child successful?
@@ -235,8 +234,8 @@
   std::string BytecodeResult;
   if (runPasses(Passes, BytecodeResult, false/*delete*/, true/*quiet*/)) {
     if (AutoDebugCrashes) {
-      llvm_cerr << " Error running this sequence of passes"
-                << " on the input program!\n";
+      cerr << " Error running this sequence of passes"
+           << " on the input program!\n";
       delete OldProgram;
       EmitProgressBytecode("pass-error",  false);
       exit(debugOptimizerCrash());
@@ -250,8 +249,8 @@
 
   Module *Ret = ParseInputFile(BytecodeResult);
   if (Ret == 0) {
-    llvm_cerr << getToolName() << ": Error reading bytecode file '"
-              << BytecodeResult << "'!\n";
+    cerr << getToolName() << ": Error reading bytecode file '"
+         << BytecodeResult << "'!\n";
     exit(1);
   }
   sys::Path(BytecodeResult).eraseFromDisk();  // No longer need the file on disk
diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp
index a898d4c..2d08f36 100644
--- a/tools/gccas/gccas.cpp
+++ b/tools/gccas/gccas.cpp
@@ -143,7 +143,7 @@
     ParseError Err;
     std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename,&Err));
     if (M.get() == 0) {
-      llvm_cerr << argv[0] << ": " << Err.getMessage() << "\n"; 
+      cerr << argv[0] << ": " << Err.getMessage() << "\n"; 
       return 1;
     }
 
@@ -178,7 +178,7 @@
 
 
     if (!Out->good()) {
-      llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
 
@@ -197,7 +197,7 @@
     Passes.add(createVerifierPass());
 
     // Write bytecode to file...
-    llvm_ostream L(*Out);
+    OStream L(*Out);
     Passes.add(new WriteBytecodePass(&L,false,!NoCompress));
 
     // Run our queue of passes all at once now, efficiently.
@@ -206,9 +206,9 @@
     if (Out != &std::cout) delete Out;
     return 0;
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
   }
   return 1;
 }
diff --git a/tools/gccld/GenerateCode.cpp b/tools/gccld/GenerateCode.cpp
index c84c7d36..13bda75 100644
--- a/tools/gccld/GenerateCode.cpp
+++ b/tools/gccld/GenerateCode.cpp
@@ -123,10 +123,10 @@
 }
 
 static void dumpArgs(const char **args) {
-  llvm_cerr << *args++;
+  cerr << *args++;
   while (*args)
-    llvm_cerr << ' ' << *args++;
-  llvm_cerr << '\n' << std::flush;
+    cerr << ' ' << *args++;
+  cerr << '\n' << std::flush;
 }
 
 static inline void addPass(PassManager &PM, Pass *P) {
@@ -283,7 +283,7 @@
   Passes.add(createVerifierPass());
 
   // Add the pass that writes bytecode to the output file...
-  llvm_ostream L(*Out);
+  OStream L(*Out);
   addPass(Passes, new WriteBytecodePass(&L, false, !NoCompress));
 
   // Run our queue of passes all at once now, efficiently.
diff --git a/tools/gccld/gccld.cpp b/tools/gccld/gccld.cpp
index 46ffac1..77ab03c 100644
--- a/tools/gccld/gccld.cpp
+++ b/tools/gccld/gccld.cpp
@@ -127,7 +127,7 @@
 ///  Message  - The message to print to standard error.
 ///
 static int PrintAndReturn(const char *progname, const std::string &Message) {
-  llvm_cerr << progname << ": " << Message << "\n";
+  cerr << progname << ": " << Message << "\n";
   return 1;
 }
 
@@ -141,11 +141,11 @@
   std::string ErrMsg;  
   sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0]);
   if (llvmstub.isEmpty()) {
-    llvm_cerr << "Could not find llvm-stub.exe executable!\n";
+    cerr << "Could not find llvm-stub.exe executable!\n";
     exit(1);
   }
   if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg)) {
-    llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+    cerr << argv[0] << ": " << ErrMsg << "\n";
     exit(1);    
   }
 
@@ -326,18 +326,18 @@
         return PrintAndReturn(argv[0], "Failed to find gcc");
 
       // Generate an assembly language file for the bytecode.
-      if (Verbose) llvm_cout << "Generating Assembly Code\n";
+      if (Verbose) cout << "Generating Assembly Code\n";
       std::string ErrMsg;
       if (0 != GenerateAssembly(
           AssemblyFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 2;
       }
-      if (Verbose) llvm_cout << "Generating Native Code\n";
+      if (Verbose) cout << "Generating Native Code\n";
       if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(),
                      LibPaths, Libraries, gcc, envp, LinkAsLibrary,
                      NoInternalize, RPath, SOName, ErrMsg, Verbose) ) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 2;
       }
 
@@ -366,18 +366,18 @@
         return PrintAndReturn(argv[0], "Failed to find gcc");
 
       // Generate an assembly language file for the bytecode.
-      if (Verbose) llvm_cout << "Generating C Source Code\n";
+      if (Verbose) cout << "Generating C Source Code\n";
       std::string ErrMsg;
       if (0 != GenerateCFile(
           CFile.toString(), RealBytecodeOutput, llc, ErrMsg, Verbose)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 2;
       }
-      if (Verbose) llvm_cout << "Generating Native Code\n";
+      if (Verbose) cout << "Generating Native Code\n";
       if (0 != GenerateNative(OutputFilename, CFile.toString(),
                      LibPaths, Libraries, gcc, envp, LinkAsLibrary,
                      NoInternalize, RPath, SOName, ErrMsg, Verbose)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 2;
       }
 
@@ -394,11 +394,11 @@
       // Make the bytecode file readable and directly executable in LLEE
       std::string ErrMsg;
       if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 1;
       }
       if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 1;
       }
     }
@@ -406,18 +406,18 @@
     // Make the output, whether native or script, executable as well...
     std::string ErrMsg;
     if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) {
-      llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+      cerr << argv[0] << ": " << ErrMsg << "\n";
       return 1;
     }
   } catch (const char*msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
     exitCode = 1;
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
     exitCode = 2;
   } catch (...) {
     // This really shouldn't happen, but just in case ....
-    llvm_cerr << argv[0] << ": An unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": An unexpected unknown exception occurred.\n";
     exitCode = 3;
   }
 
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp
index c1c0a0c..dd29bc1 100644
--- a/tools/llvm-as/llvm-as.cpp
+++ b/tools/llvm-as/llvm-as.cpp
@@ -62,29 +62,29 @@
     ParseError Err;
     std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename,&Err));
     if (M.get() == 0) {
-      llvm_cerr << argv[0] << ": " << Err.getMessage() << "\n"; 
+      cerr << argv[0] << ": " << Err.getMessage() << "\n"; 
       return 1;
     }
 
     if (!DisableVerify) {
       std::string Err;
       if (verifyModule(*M.get(), ReturnStatusAction, &Err)) {
-        llvm_cerr << argv[0]
-                  << ": assembly parsed, but does not verify as correct!\n";
-        llvm_cerr << Err;
+        cerr << argv[0]
+             << ": assembly parsed, but does not verify as correct!\n";
+        cerr << Err;
         return 1;
       } 
     }
 
-    if (DumpAsm) llvm_cerr << "Here's the assembly:\n" << *M.get();
+    if (DumpAsm) cerr << "Here's the assembly:\n" << *M.get();
 
     if (OutputFilename != "") {   // Specified an output filename?
       if (OutputFilename != "-") {  // Not stdout?
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                    << "': file exists!\n"
-                    << "Use -f command line argument to force output\n";
+          cerr << argv[0] << ": error opening '" << OutputFilename
+               << "': file exists!\n"
+               << "Use -f command line argument to force output\n";
           return 1;
         }
         Out = new std::ofstream(OutputFilename.c_str(), std::ios::out |
@@ -110,9 +110,9 @@
 
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                    << "': file exists!\n"
-                    << "Use -f command line argument to force output\n";
+          cerr << argv[0] << ": error opening '" << OutputFilename
+               << "': file exists!\n"
+               << "Use -f command line argument to force output\n";
           return 1;
         }
 
@@ -125,19 +125,19 @@
     }
 
     if (!Out->good()) {
-      llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
 
     if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
-      llvm_ostream L(*Out);
+      OStream L(*Out);
       WriteBytecodeToFile(M.get(), L, !NoCompress);
     }
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
     exitCode = 1;
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
     exitCode = 1;
   }
 
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp
index 8d9e9aa..d2022fd 100644
--- a/tools/llvm-dis/llvm-dis.cpp
+++ b/tools/llvm-dis/llvm-dis.cpp
@@ -50,11 +50,11 @@
 
     std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
     if (M.get() == 0) {
-      llvm_cerr << argv[0] << ": ";
+      cerr << argv[0] << ": ";
       if (ErrorMessage.size())
-        llvm_cerr << ErrorMessage << "\n";
+        cerr << ErrorMessage << "\n";
       else
-        llvm_cerr << "bytecode didn't read correctly.\n";
+        cerr << "bytecode didn't read correctly.\n";
       return 1;
     }
 
@@ -62,8 +62,8 @@
       if (OutputFilename != "-") { // Not stdout?
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                    << "': file exists! Sending to standard output.\n";
+          cerr << argv[0] << ": error opening '" << OutputFilename
+               << "': file exists! Sending to standard output.\n";
         } else {
           Out = new std::ofstream(OutputFilename.c_str());
         }
@@ -83,8 +83,8 @@
 
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                    << "': file exists! Sending to standard output.\n";
+          cerr << argv[0] << ": error opening '" << OutputFilename
+               << "': file exists! Sending to standard output.\n";
         } else {
           Out = new std::ofstream(OutputFilename.c_str());
 
@@ -96,14 +96,14 @@
     }
 
     if (!Out->good()) {
-      llvm_cerr << argv[0] << ": error opening " << OutputFilename
-                << ": sending to stdout instead!\n";
+      cerr << argv[0] << ": error opening " << OutputFilename
+           << ": sending to stdout instead!\n";
       Out = &std::cout;
     }
 
     // All that llvm-dis does is write the assembly to a file.
     PassManager Passes;
-    llvm_ostream L(*Out);
+    OStream L(*Out);
     Passes.add(new PrintModulePass(&L));
     Passes.run(*M.get());
 
@@ -113,9 +113,9 @@
     }
     return 0;
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
   }
 
   return 1;
diff --git a/tools/llvm-extract/llvm-extract.cpp b/tools/llvm-extract/llvm-extract.cpp
index a6edc72..882455f 100644
--- a/tools/llvm-extract/llvm-extract.cpp
+++ b/tools/llvm-extract/llvm-extract.cpp
@@ -55,15 +55,15 @@
 
     std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename));
     if (M.get() == 0) {
-      llvm_cerr << argv[0] << ": bytecode didn't read correctly.\n";
+      cerr << argv[0] << ": bytecode didn't read correctly.\n";
       return 1;
     }
 
     // Figure out which function we should extract
     Function *F = M.get()->getNamedFunction(ExtractFunc);
     if (F == 0) {
-      llvm_cerr << argv[0] << ": program doesn't contain function named '"
-                << ExtractFunc << "'!\n";
+      cerr << argv[0] << ": program doesn't contain function named '"
+           << ExtractFunc << "'!\n";
       return 1;
     }
 
@@ -82,9 +82,9 @@
     if (OutputFilename != "-") {  // Not stdout?
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                  << "': file exists!\n"
-                  << "Use -f command line argument to force output\n";
+        cerr << argv[0] << ": error opening '" << OutputFilename
+             << "': file exists!\n"
+             << "Use -f command line argument to force output\n";
         return 1;
       }
       std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
@@ -95,7 +95,7 @@
       Out = &std::cout;
     }
 
-    llvm_ostream L(*Out);
+    OStream L(*Out);
     Passes.add(new WriteBytecodePass(&L));  // Write bytecode to file...
     Passes.run(*M.get());
 
@@ -103,9 +103,9 @@
       delete Out;
     return 0;
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
   }
   return 1;
 }
diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp
index 20ea463..2e59906 100644
--- a/tools/llvm-ld/llvm-ld.cpp
+++ b/tools/llvm-ld/llvm-ld.cpp
@@ -109,7 +109,7 @@
 ///  Message  - The message to print to standard error.
 ///
 static int PrintAndReturn(const std::string &Message) {
-  llvm_cerr << progname << ": " << Message << "\n";
+  cerr << progname << ": " << Message << "\n";
   return 1;
 }
 
@@ -208,7 +208,7 @@
   sys::RemoveFileOnSignal(sys::Path(FileName));
 
   // Write it out
-  llvm_ostream L(Out);
+  OStream L(Out);
   WriteBytecodeToFile(M, L, !DisableCompression);
 
   // Close the bytecode file.
@@ -352,12 +352,12 @@
   std::string ErrMsg;  
   sys::Path llvmstub = FindExecutable("llvm-stub.exe", argv[0]);
   if (llvmstub.isEmpty()) {
-    llvm_cerr << "Could not find llvm-stub.exe executable!\n";
+    cerr << "Could not find llvm-stub.exe executable!\n";
     exit(1);
   }
 
   if (0 != sys::CopyFile(sys::Path(OutputFilename), llvmstub, &ErrMsg)) {
-    llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+    cerr << argv[0] << ": " << ErrMsg << "\n";
     exit(1);    
   }
 
@@ -520,14 +520,14 @@
               sys::Path target(RealBytecodeOutput);
               target.eraseFromDisk();
               if (tmp_output.renamePathOnDisk(target, &ErrMsg)) {
-                llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+                cerr << argv[0] << ": " << ErrMsg << "\n";
                 return 2;
               }
             } else
               return PrintAndReturn(
                 "Post-link optimization output is not bytecode");
           } else {
-            llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+            cerr << argv[0] << ": " << ErrMsg << "\n";
             return 2;
           }
         }
@@ -556,18 +556,18 @@
           return PrintAndReturn("Failed to find gcc");
 
         // Generate an assembly language file for the bytecode.
-        if (Verbose) llvm_cout << "Generating Assembly Code\n";
+        if (Verbose) cout << "Generating Assembly Code\n";
         std::string ErrMsg;
         if (0 != GenerateAssembly(AssemblyFile.toString(), RealBytecodeOutput,
             llc, ErrMsg)) {
-          llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+          cerr << argv[0] << ": " << ErrMsg << "\n";
           return 1;
         }
 
-        if (Verbose) llvm_cout << "Generating Native Code\n";
+        if (Verbose) cout << "Generating Native Code\n";
         if (0 != GenerateNative(OutputFilename, AssemblyFile.toString(),
             LinkItems,gcc,envp,ErrMsg)) {
-          llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+          cerr << argv[0] << ": " << ErrMsg << "\n";
           return 1;
         }
 
@@ -591,18 +591,18 @@
           return PrintAndReturn("Failed to find gcc");
 
         // Generate an assembly language file for the bytecode.
-        if (Verbose) llvm_cout << "Generating Assembly Code\n";
+        if (Verbose) cout << "Generating Assembly Code\n";
         std::string ErrMsg;
         if (0 != GenerateCFile(
             CFile.toString(), RealBytecodeOutput, llc, ErrMsg)) {
-          llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+          cerr << argv[0] << ": " << ErrMsg << "\n";
           return 1;
         }
 
-        if (Verbose) llvm_cout << "Generating Native Code\n";
+        if (Verbose) cout << "Generating Native Code\n";
         if (0 != GenerateNative(OutputFilename, CFile.toString(), LinkItems, 
             gcc, envp, ErrMsg)) {
-          llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+          cerr << argv[0] << ": " << ErrMsg << "\n";
           return 1;
         }
 
@@ -616,26 +616,26 @@
       // Make the script executable...
       std::string ErrMsg;
       if (sys::Path(OutputFilename).makeExecutableOnDisk(&ErrMsg)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 1;
       }
 
       // Make the bytecode file readable and directly executable in LLEE as well
       if (sys::Path(RealBytecodeOutput).makeExecutableOnDisk(&ErrMsg)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 1;
       }
       if (sys::Path(RealBytecodeOutput).makeReadableOnDisk(&ErrMsg)) {
-        llvm_cerr << argv[0] << ": " << ErrMsg << "\n";
+        cerr << argv[0] << ": " << ErrMsg << "\n";
         return 1;
       }
     }
 
     return 0;
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
   }
   return 1;
 }
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index 35fce1e..be556d1 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -52,24 +52,23 @@
 static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
   sys::Path Filename;
   if (!Filename.set(FN)) {
-    llvm_cerr << "Invalid file name: '" << FN << "'\n";
+    cerr << "Invalid file name: '" << FN << "'\n";
     return std::auto_ptr<Module>();
   }
 
   std::string ErrorMessage;
   if (Filename.exists()) {
-    if (Verbose) llvm_cerr << "Loading '" << Filename.c_str() << "'\n";
+    if (Verbose) cerr << "Loading '" << Filename.c_str() << "'\n";
     Module* Result = ParseBytecodeFile(Filename.toString(), &ErrorMessage);
     if (Result) return std::auto_ptr<Module>(Result);   // Load successful!
 
     if (Verbose) {
-      llvm_cerr << "Error opening bytecode file: '" << Filename.c_str() << "'";
-      if (ErrorMessage.size()) llvm_cerr << ": " << ErrorMessage;
-      llvm_cerr << "\n";
+      cerr << "Error opening bytecode file: '" << Filename.c_str() << "'";
+      if (ErrorMessage.size()) cerr << ": " << ErrorMessage;
+      cerr << "\n";
     }
   } else {
-    llvm_cerr << "Bytecode file: '" << Filename.c_str()
-              << "' does not exist.\n";
+    cerr << "Bytecode file: '" << Filename.c_str() << "' does not exist.\n";
   }
 
   return std::auto_ptr<Module>();
@@ -87,24 +86,23 @@
 
     std::auto_ptr<Module> Composite(LoadFile(InputFilenames[BaseArg]));
     if (Composite.get() == 0) {
-      llvm_cerr << argv[0] << ": error loading file '"
-                << InputFilenames[BaseArg] << "'\n";
+      cerr << argv[0] << ": error loading file '"
+           << InputFilenames[BaseArg] << "'\n";
       return 1;
     }
 
     for (unsigned i = BaseArg+1; i < InputFilenames.size(); ++i) {
       std::auto_ptr<Module> M(LoadFile(InputFilenames[i]));
       if (M.get() == 0) {
-        llvm_cerr << argv[0] << ": error loading file '"
-                  << InputFilenames[i] << "'\n";
+        cerr << argv[0] << ": error loading file '" <<InputFilenames[i]<< "'\n";
         return 1;
       }
 
-      if (Verbose) llvm_cerr << "Linking in '" << InputFilenames[i] << "'\n";
+      if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n";
 
       if (Linker::LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
-        llvm_cerr << argv[0] << ": link error in '" << InputFilenames[i]
-                  << "': " << ErrorMessage << "\n";
+        cerr << argv[0] << ": link error in '" << InputFilenames[i]
+             << "': " << ErrorMessage << "\n";
         return 1;
       }
     }
@@ -112,23 +110,23 @@
     // TODO: Iterate over the -l list and link in any modules containing
     // global symbols that have not been resolved so far.
 
-    if (DumpAsm) llvm_cerr << "Here's the assembly:\n" << *Composite.get();
+    if (DumpAsm) cerr << "Here's the assembly:\n" << *Composite.get();
 
     // FIXME: cout is not binary!
     std::ostream *Out = &std::cout;  // Default to printing to stdout...
     if (OutputFilename != "-") {
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                  << "': file exists!\n"
-                  << "Use -f command line argument to force output\n";
+        cerr << argv[0] << ": error opening '" << OutputFilename
+             << "': file exists!\n"
+             << "Use -f command line argument to force output\n";
         return 1;
       }
       std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
                                    std::ios::binary;
       Out = new std::ofstream(OutputFilename.c_str(), io_mode);
       if (!Out->good()) {
-        llvm_cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
+        cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
         return 1;
       }
 
@@ -138,20 +136,20 @@
     }
 
     if (verifyModule(*Composite.get())) {
-      llvm_cerr << argv[0] << ": linked module is broken!\n";
+      cerr << argv[0] << ": linked module is broken!\n";
       return 1;
     }
 
-    if (Verbose) llvm_cerr << "Writing bytecode...\n";
-    llvm_ostream L(*Out);
+    if (Verbose) cerr << "Writing bytecode...\n";
+    OStream L(*Out);
     WriteBytecodeToFile(Composite.get(), L, !NoCompress);
 
     if (Out != &std::cout) delete Out;
     return 0;
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
   }
   return 1;
 }
diff --git a/tools/llvm-upgrade/llvm-upgrade.cpp b/tools/llvm-upgrade/llvm-upgrade.cpp
index d39aa92..65ee452 100644
--- a/tools/llvm-upgrade/llvm-upgrade.cpp
+++ b/tools/llvm-upgrade/llvm-upgrade.cpp
@@ -57,9 +57,9 @@
       if (OutputFilename != "-") {  // Not stdout?
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                    << "': file exists!\n"
-                    << "Use -f command line argument to force output\n";
+          cerr << argv[0] << ": error opening '" << OutputFilename
+               << "': file exists!\n"
+               << "Use -f command line argument to force output\n";
           return 1;
         }
         Out = new std::ofstream(OutputFilename.c_str(), std::ios::out |
@@ -84,9 +84,9 @@
 
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                    << "': file exists!\n"
-                    << "Use -f command line argument to force output\n";
+          cerr << argv[0] << ": error opening '" << OutputFilename
+               << "': file exists!\n"
+               << "Use -f command line argument to force output\n";
           return 1;
         }
 
@@ -106,22 +106,22 @@
     }
 
     if (!Out->good()) {
-      llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
 
     if (!In->good()) {
-      llvm_cerr << argv[0] << ": error opening " << InputFilename << "!\n";
+      cerr << argv[0] << ": error opening " << InputFilename << "!\n";
       return 1;
     }
 
     UpgradeAssembly(InputFilename, *In, *Out, Debug);
 
   } catch (const std::string& caught_message) {
-    llvm_cerr << argv[0] << ": " << caught_message << "\n";
+    cerr << argv[0] << ": " << caught_message << "\n";
     exitCode = 1;
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
     exitCode = 1;
   }
 
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index 65fcef6..4308297 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -361,7 +361,7 @@
     std::string tempFileName(FinalOutputPath.c_str());
     tempFileName += "0.bc";
     std::ofstream Out(tempFileName.c_str(), io_mode);
-    llvm_ostream L(Out);
+    OStream L(Out);
     WriteBytecodeToFile(bigOne, L, true);
   }
 
@@ -378,17 +378,17 @@
   std::string ErrMsg;
   sys::Path TempDir = sys::Path::GetTemporaryDirectory(&ErrMsg);
   if (TempDir.isEmpty()) {
-    llvm_cerr << "lto: " << ErrMsg << "\n";
+    cerr << "lto: " << ErrMsg << "\n";
     return LTO_WRITE_FAILURE;
   }
   sys::Path tmpAsmFilePath(TempDir);
   if (!tmpAsmFilePath.appendComponent("lto")) {
-    llvm_cerr << "lto: " << ErrMsg << "\n";
+    cerr << "lto: " << ErrMsg << "\n";
     TempDir.eraseFromDisk(true);
     return LTO_WRITE_FAILURE;
   }
   if (tmpAsmFilePath.createTemporaryFileOnDisk(&ErrMsg)) {
-    llvm_cerr << "lto: " << ErrMsg << "\n";
+    cerr << "lto: " << ErrMsg << "\n";
     TempDir.eraseFromDisk(true);
     return LTO_WRITE_FAILURE;
   }
@@ -415,7 +415,7 @@
     std::string tempFileName(FinalOutputPath.c_str());
     tempFileName += "1.bc";
     std::ofstream Out(tempFileName.c_str(), io_mode);
-    llvm_ostream L(Out);
+    OStream L(Out);
     WriteBytecodeToFile(bigOne, L, true);
   }
 
@@ -445,7 +445,7 @@
   args.push_back(0);
 
   if (sys::Program::ExecuteAndWait(gcc, &args[0], 0, 0, 1, &ErrMsg)) {
-    llvm_cerr << "lto: " << ErrMsg << "\n";
+    cerr << "lto: " << ErrMsg << "\n";
     return LTO_ASM_FAILURE;
   }
 
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 6afdc68..7d5dd21 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -87,9 +87,8 @@
 
   virtual bool runOnModule(Module &M) {
     if (!Quiet) {
-      llvm_cout << "Printing analysis '" << PassToPrint->getPassName() 
-                << "':\n";
-      getAnalysisID<Pass>(PassToPrint).print(llvm_cout, &M);
+      cout << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
+      getAnalysisID<Pass>(PassToPrint).print(cout, &M);
     }
 
     // Get and print pass...
@@ -110,11 +109,11 @@
 
   virtual bool runOnFunction(Function &F) {
     if (!Quiet) {
-      llvm_cout << "Printing analysis '" << PassToPrint->getPassName()
-		<< "' for function '" << F.getName() << "':\n";
+      cout << "Printing analysis '" << PassToPrint->getPassName()
+           << "' for function '" << F.getName() << "':\n";
     }
     // Get and print pass...
-    getAnalysisID<Pass>(PassToPrint).print(llvm_cout, F.getParent());
+    getAnalysisID<Pass>(PassToPrint).print(cout, F.getParent());
     return false;
   }
 
@@ -132,13 +131,12 @@
 
   virtual bool runOnBasicBlock(BasicBlock &BB) {
     if (!Quiet) {
-      llvm_cout << "Printing Analysis info for BasicBlock '" << BB.getName()
-		<< "': Pass " << PassToPrint->getPassName() << ":\n";
+      cout << "Printing Analysis info for BasicBlock '" << BB.getName()
+           << "': Pass " << PassToPrint->getPassName() << ":\n";
     }
 
     // Get and print pass...
-    getAnalysisID<Pass>(PassToPrint).print(
-      llvm_cout, BB.getParent()->getParent());
+    getAnalysisID<Pass>(PassToPrint).print(cout, BB.getParent()->getParent());
     return false;
   }
 
@@ -172,11 +170,11 @@
     // Load the input module...
     std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
     if (M.get() == 0) {
-      llvm_cerr << argv[0] << ": ";
+      cerr << argv[0] << ": ";
       if (ErrorMessage.size())
-        llvm_cerr << ErrorMessage << "\n";
+        cerr << ErrorMessage << "\n";
       else
-        llvm_cerr << "bytecode didn't read correctly.\n";
+        cerr << "bytecode didn't read correctly.\n";
       return 1;
     }
 
@@ -186,9 +184,9 @@
     if (OutputFilename != "-") {
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        llvm_cerr << argv[0] << ": error opening '" << OutputFilename
-                  << "': file exists!\n"
-                  << "Use -f command line argument to force output\n";
+        cerr << argv[0] << ": error opening '" << OutputFilename
+             << "': file exists!\n"
+             << "Use -f command line argument to force output\n";
         return 1;
       }
       std::ios::openmode io_mode = std::ios::out | std::ios::trunc |
@@ -196,7 +194,7 @@
       Out = new std::ofstream(OutputFilename.c_str(), io_mode);
 
       if (!Out->good()) {
-        llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+        cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
         return 1;
       }
 
@@ -227,8 +225,8 @@
       if (PassInf->getNormalCtor())
         P = PassInf->getNormalCtor()();
       else
-        llvm_cerr << argv[0] << ": cannot create pass: "
-                  << PassInf->getPassName() << "\n";
+        cerr << argv[0] << ": cannot create pass: "
+             << PassInf->getPassName() << "\n";
       if (P) {
         Passes.add(P);
         
@@ -243,7 +241,7 @@
       }
       
       if (PrintEachXForm)
-        Passes.add(new PrintModulePass(&llvm_cerr));
+        Passes.add(new PrintModulePass(&cerr));
     }
 
     // Check that the module is well formed on completion of optimization
@@ -251,7 +249,7 @@
       Passes.add(createVerifierPass());
 
     // Write bytecode out to disk or cout as the last step...
-    llvm_ostream L(*Out);
+    OStream L(*Out);
     if (!NoOutput && !AnalyzeOnly)
       Passes.add(new WriteBytecodePass(&L, false, !NoCompress));
 
@@ -261,9 +259,9 @@
     return 0;
 
   } catch (const std::string& msg) {
-    llvm_cerr << argv[0] << ": " << msg << "\n";
+    cerr << argv[0] << ": " << msg << "\n";
   } catch (...) {
-    llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+    cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
   }
   return 1;
 }