Kill using declarations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6292 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/as/as.cpp b/tools/as/as.cpp
index c9bd3b4..d1f7406 100644
--- a/tools/as/as.cpp
+++ b/tools/as/as.cpp
@@ -17,13 +17,11 @@
 #include "Support/Signals.h"
 #include <fstream>
 #include <memory>
-using std::cerr;
-using std::string;
 
-static cl::opt<string> 
+static cl::opt<std::string> 
 InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
 
-static cl::opt<string>
+static cl::opt<std::string>
 OutputFilename("o", cl::desc("Override output filename"),
                cl::value_desc("filename"));
 
@@ -41,24 +39,25 @@
     // Parse the file now...
     std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
     if (M.get() == 0) {
-      cerr << argv[0] << ": assembly didn't read correctly.\n";
+      std::cerr << argv[0] << ": assembly didn't read correctly.\n";
       return 1;
     }
 
     if (verifyModule(*M.get())) {
-      cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n";
+      std::cerr << argv[0]
+                << ": assembly parsed, but does not verify as correct!\n";
       return 1;
     }
 
   
-    if (DumpAsm) cerr << "Here's the assembly:\n" << M.get();
+    if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
 
     if (OutputFilename != "") {   // Specified an output filename?
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << argv[0] << ": error opening '" << OutputFilename
-             << "': file exists!\n"
-             << "Use -f command line argument to force output\n";
+        std::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());
@@ -79,9 +78,9 @@
 
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          cerr << argv[0] << ": error opening '" << OutputFilename
-               << "': file exists!\n"
-               << "Use -f command line argument to force output\n";
+          std::cerr << argv[0] << ": error opening '" << OutputFilename
+                    << "': file exists!\n"
+                    << "Use -f command line argument to force output\n";
           return 1;
         }
 
@@ -93,13 +92,13 @@
     }
   
     if (!Out->good()) {
-      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
    
     WriteBytecodeToFile(M.get(), *Out);
   } catch (const ParseException &E) {
-    cerr << argv[0] << ": " << E.getMessage() << "\n";
+    std::cerr << argv[0] << ": " << E.getMessage() << "\n";
     return 1;
   }
 
diff --git a/tools/dis/dis.cpp b/tools/dis/dis.cpp
index a48dd7e..b52354e 100644
--- a/tools/dis/dis.cpp
+++ b/tools/dis/dis.cpp
@@ -20,7 +20,6 @@
 #include "Support/Signals.h"
 #include <fstream>
 #include <memory>
-using std::cerr;
 
 // OutputMode - The different orderings to print basic blocks in...
 enum OutputMode {
@@ -52,19 +51,19 @@
 
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
   if (M.get() == 0) {
-    cerr << argv[0] << ": ";
+    std::cerr << argv[0] << ": ";
     if (ErrorMessage.size())
-      cerr << ErrorMessage << "\n";
+      std::cerr << ErrorMessage << "\n";
     else
-      cerr << "bytecode didn't read correctly.\n";
+      std::cerr << "bytecode didn't read correctly.\n";
     return 1;
   }
   
   if (OutputFilename != "") {   // Specified an output filename?
     if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
-      cerr << argv[0] << ": error opening '" << OutputFilename
-           << "': file exists! Sending to standard output.\n";
+      std::cerr << argv[0] << ": error opening '" << OutputFilename
+                << "': file exists! Sending to standard output.\n";
     } else {
       Out = new std::ofstream(OutputFilename.c_str());
     }
@@ -87,8 +86,8 @@
 
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << argv[0] << ": error opening '" << OutputFilename
-             << "': file exists! Sending to standard output.\n";
+        std::cerr << argv[0] << ": error opening '" << OutputFilename
+                  << "': file exists! Sending to standard output.\n";
       } else {
         Out = new std::ofstream(OutputFilename.c_str());
 
@@ -100,8 +99,8 @@
   }
 
   if (!Out->good()) {
-    cerr << argv[0] << ": error opening " << OutputFilename
-	 << ": sending to stdout instead!\n";
+    std::cerr << argv[0] << ": error opening " << OutputFilename
+              << ": sending to stdout instead!\n";
     Out = &std::cout;
   }
 
diff --git a/tools/link/link.cpp b/tools/link/link.cpp
index 075e707..1196e42 100644
--- a/tools/link/link.cpp
+++ b/tools/link/link.cpp
@@ -20,8 +20,6 @@
 #include <sys/types.h>     // For FileExists
 #include <sys/stat.h>
 
-using std::cerr;
-
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::OneOrMore,
                cl::desc("<input bytecode files>"));
@@ -59,15 +57,15 @@
   bool FoundAFile = false;
 
   while (1) {
-    if (Verbose) cerr << "Loading '" << Filename << "'\n";
+    if (Verbose) std::cerr << "Loading '" << Filename << "'\n";
     if (FileExists(Filename)) FoundAFile = true;
     Module *Result = ParseBytecodeFile(Filename, &ErrorMessage);
     if (Result) return std::auto_ptr<Module>(Result);   // Load successful!
 
     if (Verbose) {
-      cerr << "Error opening bytecode file: '" << Filename << "'";
-      if (ErrorMessage.size()) cerr << ": " << ErrorMessage;
-      cerr << "\n";
+      std::cerr << "Error opening bytecode file: '" << Filename << "'";
+      if (ErrorMessage.size()) std::cerr << ": " << ErrorMessage;
+      std::cerr << "\n";
     }
     
     if (NextLibPathIdx == LibPaths.size()) break;
@@ -75,10 +73,10 @@
   }
 
   if (FoundAFile)
-    cerr << "Bytecode file '" << FN << "' corrupt!  "
-         << "Use 'link -v ...' for more info.\n";
+    std::cerr << "Bytecode file '" << FN << "' corrupt!  "
+              << "Use 'link -v ...' for more info.\n";
   else
-    cerr << "Could not locate bytecode file: '" << FN << "'\n";
+    std::cerr << "Could not locate bytecode file: '" << FN << "'\n";
   return std::auto_ptr<Module>();
 }
 
@@ -106,29 +104,29 @@
     std::auto_ptr<Module> M(LoadFile(InputFilenames[i]));
     if (M.get() == 0) return 1;
 
-    if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n";
+    if (Verbose) std::cerr << "Linking in '" << InputFilenames[i] << "'\n";
 
     if (LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
-      cerr << argv[0] << ": error linking in '" << InputFilenames[i] << "': "
-	   << ErrorMessage << "\n";
+      std::cerr << argv[0] << ": error linking in '" << InputFilenames[i]
+                << "': " << ErrorMessage << "\n";
       return 1;
     }
   }
 
-  if (DumpAsm) cerr << "Here's the assembly:\n" << Composite.get();
+  if (DumpAsm) std::cerr << "Here's the assembly:\n" << Composite.get();
 
   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!
-      cerr << argv[0] << ": error opening '" << OutputFilename
-           << "': file exists!\n"
-           << "Use -f command line argument to force output\n";
+      std::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());
     if (!Out->good()) {
-      cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
+      std::cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
       return 1;
     }
 
@@ -137,7 +135,7 @@
     RemoveFileOnSignal(OutputFilename);
   }
 
-  if (Verbose) cerr << "Writing bytecode...\n";
+  if (Verbose) std::cerr << "Writing bytecode...\n";
   WriteBytecodeToFile(Composite.get(), *Out);
 
   if (Out != &std::cout) delete Out;
diff --git a/tools/llvm-as/as.cpp b/tools/llvm-as/as.cpp
index c9bd3b4..d1f7406 100644
--- a/tools/llvm-as/as.cpp
+++ b/tools/llvm-as/as.cpp
@@ -17,13 +17,11 @@
 #include "Support/Signals.h"
 #include <fstream>
 #include <memory>
-using std::cerr;
-using std::string;
 
-static cl::opt<string> 
+static cl::opt<std::string> 
 InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
 
-static cl::opt<string>
+static cl::opt<std::string>
 OutputFilename("o", cl::desc("Override output filename"),
                cl::value_desc("filename"));
 
@@ -41,24 +39,25 @@
     // Parse the file now...
     std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
     if (M.get() == 0) {
-      cerr << argv[0] << ": assembly didn't read correctly.\n";
+      std::cerr << argv[0] << ": assembly didn't read correctly.\n";
       return 1;
     }
 
     if (verifyModule(*M.get())) {
-      cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n";
+      std::cerr << argv[0]
+                << ": assembly parsed, but does not verify as correct!\n";
       return 1;
     }
 
   
-    if (DumpAsm) cerr << "Here's the assembly:\n" << M.get();
+    if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
 
     if (OutputFilename != "") {   // Specified an output filename?
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << argv[0] << ": error opening '" << OutputFilename
-             << "': file exists!\n"
-             << "Use -f command line argument to force output\n";
+        std::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());
@@ -79,9 +78,9 @@
 
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          cerr << argv[0] << ": error opening '" << OutputFilename
-               << "': file exists!\n"
-               << "Use -f command line argument to force output\n";
+          std::cerr << argv[0] << ": error opening '" << OutputFilename
+                    << "': file exists!\n"
+                    << "Use -f command line argument to force output\n";
           return 1;
         }
 
@@ -93,13 +92,13 @@
     }
   
     if (!Out->good()) {
-      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
    
     WriteBytecodeToFile(M.get(), *Out);
   } catch (const ParseException &E) {
-    cerr << argv[0] << ": " << E.getMessage() << "\n";
+    std::cerr << argv[0] << ": " << E.getMessage() << "\n";
     return 1;
   }
 
diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp
index c9bd3b4..d1f7406 100644
--- a/tools/llvm-as/llvm-as.cpp
+++ b/tools/llvm-as/llvm-as.cpp
@@ -17,13 +17,11 @@
 #include "Support/Signals.h"
 #include <fstream>
 #include <memory>
-using std::cerr;
-using std::string;
 
-static cl::opt<string> 
+static cl::opt<std::string> 
 InputFilename(cl::Positional, cl::desc("<input .llvm file>"), cl::init("-"));
 
-static cl::opt<string>
+static cl::opt<std::string>
 OutputFilename("o", cl::desc("Override output filename"),
                cl::value_desc("filename"));
 
@@ -41,24 +39,25 @@
     // Parse the file now...
     std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename));
     if (M.get() == 0) {
-      cerr << argv[0] << ": assembly didn't read correctly.\n";
+      std::cerr << argv[0] << ": assembly didn't read correctly.\n";
       return 1;
     }
 
     if (verifyModule(*M.get())) {
-      cerr << argv[0] << ": assembly parsed, but does not verify as correct!\n";
+      std::cerr << argv[0]
+                << ": assembly parsed, but does not verify as correct!\n";
       return 1;
     }
 
   
-    if (DumpAsm) cerr << "Here's the assembly:\n" << M.get();
+    if (DumpAsm) std::cerr << "Here's the assembly:\n" << M.get();
 
     if (OutputFilename != "") {   // Specified an output filename?
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << argv[0] << ": error opening '" << OutputFilename
-             << "': file exists!\n"
-             << "Use -f command line argument to force output\n";
+        std::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());
@@ -79,9 +78,9 @@
 
         if (!Force && std::ifstream(OutputFilename.c_str())) {
           // If force is not specified, make sure not to overwrite a file!
-          cerr << argv[0] << ": error opening '" << OutputFilename
-               << "': file exists!\n"
-               << "Use -f command line argument to force output\n";
+          std::cerr << argv[0] << ": error opening '" << OutputFilename
+                    << "': file exists!\n"
+                    << "Use -f command line argument to force output\n";
           return 1;
         }
 
@@ -93,13 +92,13 @@
     }
   
     if (!Out->good()) {
-      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
    
     WriteBytecodeToFile(M.get(), *Out);
   } catch (const ParseException &E) {
-    cerr << argv[0] << ": " << E.getMessage() << "\n";
+    std::cerr << argv[0] << ": " << E.getMessage() << "\n";
     return 1;
   }
 
diff --git a/tools/llvm-dis/dis.cpp b/tools/llvm-dis/dis.cpp
index a48dd7e..b52354e 100644
--- a/tools/llvm-dis/dis.cpp
+++ b/tools/llvm-dis/dis.cpp
@@ -20,7 +20,6 @@
 #include "Support/Signals.h"
 #include <fstream>
 #include <memory>
-using std::cerr;
 
 // OutputMode - The different orderings to print basic blocks in...
 enum OutputMode {
@@ -52,19 +51,19 @@
 
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
   if (M.get() == 0) {
-    cerr << argv[0] << ": ";
+    std::cerr << argv[0] << ": ";
     if (ErrorMessage.size())
-      cerr << ErrorMessage << "\n";
+      std::cerr << ErrorMessage << "\n";
     else
-      cerr << "bytecode didn't read correctly.\n";
+      std::cerr << "bytecode didn't read correctly.\n";
     return 1;
   }
   
   if (OutputFilename != "") {   // Specified an output filename?
     if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
-      cerr << argv[0] << ": error opening '" << OutputFilename
-           << "': file exists! Sending to standard output.\n";
+      std::cerr << argv[0] << ": error opening '" << OutputFilename
+                << "': file exists! Sending to standard output.\n";
     } else {
       Out = new std::ofstream(OutputFilename.c_str());
     }
@@ -87,8 +86,8 @@
 
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << argv[0] << ": error opening '" << OutputFilename
-             << "': file exists! Sending to standard output.\n";
+        std::cerr << argv[0] << ": error opening '" << OutputFilename
+                  << "': file exists! Sending to standard output.\n";
       } else {
         Out = new std::ofstream(OutputFilename.c_str());
 
@@ -100,8 +99,8 @@
   }
 
   if (!Out->good()) {
-    cerr << argv[0] << ": error opening " << OutputFilename
-	 << ": sending to stdout instead!\n";
+    std::cerr << argv[0] << ": error opening " << OutputFilename
+              << ": sending to stdout instead!\n";
     Out = &std::cout;
   }
 
diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp
index a48dd7e..b52354e 100644
--- a/tools/llvm-dis/llvm-dis.cpp
+++ b/tools/llvm-dis/llvm-dis.cpp
@@ -20,7 +20,6 @@
 #include "Support/Signals.h"
 #include <fstream>
 #include <memory>
-using std::cerr;
 
 // OutputMode - The different orderings to print basic blocks in...
 enum OutputMode {
@@ -52,19 +51,19 @@
 
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
   if (M.get() == 0) {
-    cerr << argv[0] << ": ";
+    std::cerr << argv[0] << ": ";
     if (ErrorMessage.size())
-      cerr << ErrorMessage << "\n";
+      std::cerr << ErrorMessage << "\n";
     else
-      cerr << "bytecode didn't read correctly.\n";
+      std::cerr << "bytecode didn't read correctly.\n";
     return 1;
   }
   
   if (OutputFilename != "") {   // Specified an output filename?
     if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
-      cerr << argv[0] << ": error opening '" << OutputFilename
-           << "': file exists! Sending to standard output.\n";
+      std::cerr << argv[0] << ": error opening '" << OutputFilename
+                << "': file exists! Sending to standard output.\n";
     } else {
       Out = new std::ofstream(OutputFilename.c_str());
     }
@@ -87,8 +86,8 @@
 
       if (!Force && std::ifstream(OutputFilename.c_str())) {
         // If force is not specified, make sure not to overwrite a file!
-        cerr << argv[0] << ": error opening '" << OutputFilename
-             << "': file exists! Sending to standard output.\n";
+        std::cerr << argv[0] << ": error opening '" << OutputFilename
+                  << "': file exists! Sending to standard output.\n";
       } else {
         Out = new std::ofstream(OutputFilename.c_str());
 
@@ -100,8 +99,8 @@
   }
 
   if (!Out->good()) {
-    cerr << argv[0] << ": error opening " << OutputFilename
-	 << ": sending to stdout instead!\n";
+    std::cerr << argv[0] << ": error opening " << OutputFilename
+              << ": sending to stdout instead!\n";
     Out = &std::cout;
   }
 
diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp
index 075e707..1196e42 100644
--- a/tools/llvm-link/llvm-link.cpp
+++ b/tools/llvm-link/llvm-link.cpp
@@ -20,8 +20,6 @@
 #include <sys/types.h>     // For FileExists
 #include <sys/stat.h>
 
-using std::cerr;
-
 static cl::list<std::string>
 InputFilenames(cl::Positional, cl::OneOrMore,
                cl::desc("<input bytecode files>"));
@@ -59,15 +57,15 @@
   bool FoundAFile = false;
 
   while (1) {
-    if (Verbose) cerr << "Loading '" << Filename << "'\n";
+    if (Verbose) std::cerr << "Loading '" << Filename << "'\n";
     if (FileExists(Filename)) FoundAFile = true;
     Module *Result = ParseBytecodeFile(Filename, &ErrorMessage);
     if (Result) return std::auto_ptr<Module>(Result);   // Load successful!
 
     if (Verbose) {
-      cerr << "Error opening bytecode file: '" << Filename << "'";
-      if (ErrorMessage.size()) cerr << ": " << ErrorMessage;
-      cerr << "\n";
+      std::cerr << "Error opening bytecode file: '" << Filename << "'";
+      if (ErrorMessage.size()) std::cerr << ": " << ErrorMessage;
+      std::cerr << "\n";
     }
     
     if (NextLibPathIdx == LibPaths.size()) break;
@@ -75,10 +73,10 @@
   }
 
   if (FoundAFile)
-    cerr << "Bytecode file '" << FN << "' corrupt!  "
-         << "Use 'link -v ...' for more info.\n";
+    std::cerr << "Bytecode file '" << FN << "' corrupt!  "
+              << "Use 'link -v ...' for more info.\n";
   else
-    cerr << "Could not locate bytecode file: '" << FN << "'\n";
+    std::cerr << "Could not locate bytecode file: '" << FN << "'\n";
   return std::auto_ptr<Module>();
 }
 
@@ -106,29 +104,29 @@
     std::auto_ptr<Module> M(LoadFile(InputFilenames[i]));
     if (M.get() == 0) return 1;
 
-    if (Verbose) cerr << "Linking in '" << InputFilenames[i] << "'\n";
+    if (Verbose) std::cerr << "Linking in '" << InputFilenames[i] << "'\n";
 
     if (LinkModules(Composite.get(), M.get(), &ErrorMessage)) {
-      cerr << argv[0] << ": error linking in '" << InputFilenames[i] << "': "
-	   << ErrorMessage << "\n";
+      std::cerr << argv[0] << ": error linking in '" << InputFilenames[i]
+                << "': " << ErrorMessage << "\n";
       return 1;
     }
   }
 
-  if (DumpAsm) cerr << "Here's the assembly:\n" << Composite.get();
+  if (DumpAsm) std::cerr << "Here's the assembly:\n" << Composite.get();
 
   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!
-      cerr << argv[0] << ": error opening '" << OutputFilename
-           << "': file exists!\n"
-           << "Use -f command line argument to force output\n";
+      std::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());
     if (!Out->good()) {
-      cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
+      std::cerr << argv[0] << ": error opening '" << OutputFilename << "'!\n";
       return 1;
     }
 
@@ -137,7 +135,7 @@
     RemoveFileOnSignal(OutputFilename);
   }
 
-  if (Verbose) cerr << "Writing bytecode...\n";
+  if (Verbose) std::cerr << "Writing bytecode...\n";
   WriteBytecodeToFile(Composite.get(), *Out);
 
   if (Out != &std::cout) delete Out;
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index 0127c53..743bfb8 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -20,9 +20,6 @@
 #include <memory>
 #include <algorithm>
 
-using std::cerr;
-using std::string;
-
 
 // The OptimizationList is automatically populated with registered Passes by the
 // PassNameParser.
@@ -34,10 +31,10 @@
 
 // Other command line options...
 //
-static cl::opt<string>
+static cl::opt<std::string>
 InputFilename(cl::Positional, cl::desc("<input bytecode>"), cl::init("-"));
 
-static cl::opt<string>
+static cl::opt<std::string>
 OutputFilename("o", cl::desc("Override output filename"),
                cl::value_desc("filename"));
 
@@ -78,11 +75,11 @@
   // Load the input module...
   std::auto_ptr<Module> M(ParseBytecodeFile(InputFilename, &ErrorMessage));
   if (M.get() == 0) {
-    cerr << argv[0] << ": ";
+    std::cerr << argv[0] << ": ";
     if (ErrorMessage.size())
-      cerr << ErrorMessage << "\n";
+      std::cerr << ErrorMessage << "\n";
     else
-      cerr << "bytecode didn't read correctly.\n";
+      std::cerr << "bytecode didn't read correctly.\n";
     return 1;
   }
 
@@ -91,15 +88,15 @@
   if (OutputFilename != "") {
     if (!Force && std::ifstream(OutputFilename.c_str())) {
       // If force is not specified, make sure not to overwrite a file!
-      cerr << argv[0] << ": error opening '" << OutputFilename
-           << "': file exists!\n"
-           << "Use -f command line argument to force output\n";
+      std::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());
 
     if (!Out->good()) {
-      cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+      std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
       return 1;
     }
 
@@ -130,10 +127,11 @@
       assert(target.get() && "Could not allocate target machine!");
       Passes.add(Opt->getTargetCtor()(*target.get()));
     } else
-      cerr << argv[0] << ": cannot create pass: " << Opt->getPassName() << "\n";
+      std::cerr << argv[0] << ": cannot create pass: " << Opt->getPassName()
+                << "\n";
 
     if (PrintEachXForm)
-      Passes.add(new PrintModulePass(&cerr));
+      Passes.add(new PrintModulePass(&std::cerr));
   }
 
   // Check that the module is well formed on completion of optimization
@@ -146,7 +144,7 @@
 
   // Now that we have all of the passes ready, run them.
   if (Passes.run(*M.get()) && !Quiet)
-    cerr << "Program modified.\n";
+    std::cerr << "Program modified.\n";
 
   return 0;
 }