aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-05-22 20:13:16 +0000
committerChris Lattner <sabre@nondot.org>2003-05-22 20:13:16 +0000
commit6c8103f7ddb734d128739a463bcd0667d73c62aa (patch)
treed513d29aacc379458ac318f8d7c67f0825932e67
parentca6433f233b7ed432916ba07976f9a4e9e0767b0 (diff)
downloadexternal_llvm-6c8103f7ddb734d128739a463bcd0667d73c62aa.zip
external_llvm-6c8103f7ddb734d128739a463bcd0667d73c62aa.tar.gz
external_llvm-6c8103f7ddb734d128739a463bcd0667d73c62aa.tar.bz2
Kill using declarations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6292 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--tools/as/as.cpp29
-rw-r--r--tools/dis/dis.cpp19
-rw-r--r--tools/link/link.cpp34
-rw-r--r--tools/llvm-as/as.cpp29
-rw-r--r--tools/llvm-as/llvm-as.cpp29
-rw-r--r--tools/llvm-dis/dis.cpp19
-rw-r--r--tools/llvm-dis/llvm-dis.cpp19
-rw-r--r--tools/llvm-link/llvm-link.cpp34
-rw-r--r--tools/opt/opt.cpp28
9 files changed, 114 insertions, 126 deletions
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 @@ int main(int argc, char **argv) {
// 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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
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 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
}
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
// 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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ int main(int argc, char **argv) {
// 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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
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 @@ static inline std::auto_ptr<Module> LoadFile(const std::string &FN) {
}
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ OptimizationList(cl::desc("Optimizations available:"));
// 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 @@ int main(int argc, char **argv) {
// 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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
// 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;
}