aboutsummaryrefslogtreecommitdiffstats
path: root/tools/opt/opt.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-12-07 01:30:32 +0000
committerBill Wendling <isanbard@gmail.com>2006-12-07 01:30:32 +0000
commite81561909d128c6e2d8033cb5465a49b2596b26a (patch)
tree6f2845604d482bc86d8d12aae500292c561d8cd7 /tools/opt/opt.cpp
parent85c671b90870705ba7e10baf99aa306c843f1325 (diff)
downloadexternal_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.zip
external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.tar.gz
external_llvm-e81561909d128c6e2d8033cb5465a49b2596b26a.tar.bz2
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
Diffstat (limited to 'tools/opt/opt.cpp')
-rw-r--r--tools/opt/opt.cpp44
1 files changed, 21 insertions, 23 deletions
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 @@ struct ModulePassPrinter : public ModulePass {
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 @@ struct FunctionPassPrinter : public FunctionPass {
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 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
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 @@ int main(int argc, char **argv) {
// 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 @@ 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!
- 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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
}
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 @@ int main(int argc, char **argv) {
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 @@ int main(int argc, char **argv) {
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;
}