aboutsummaryrefslogtreecommitdiff
path: root/utils/TableGen/TableGen.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-12-07 22:21:48 +0000
committerBill Wendling <isanbard@gmail.com>2006-12-07 22:21:48 +0000
commitf5da13367f88f06e3b585dc2263ab6e9ca6c4bf8 (patch)
tree3cf9a9612ba0a90fee9ec668819ae5a69a7bada1 /utils/TableGen/TableGen.cpp
parent6e49d8b4bf7b5911dc953551672161b8f9a7418f (diff)
What should be the last unnecessary <iostream>s in the library.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/TableGen.cpp')
-rw-r--r--utils/TableGen/TableGen.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/TableGen/TableGen.cpp b/utils/TableGen/TableGen.cpp
index 1adc448b5b..4345234c27 100644
--- a/utils/TableGen/TableGen.cpp
+++ b/utils/TableGen/TableGen.cpp
@@ -17,6 +17,7 @@
#include "Record.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Streams.h"
#include "llvm/System/Signals.h"
#include "llvm/Support/FileUtilities.h"
#include "CodeEmitterGen.h"
@@ -99,12 +100,12 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv);
ParseFile(InputFilename, IncludeDirs);
- std::ostream *Out = &std::cout;
+ std::ostream *Out = cout.stream();
if (OutputFilename != "-") {
Out = new std::ofstream(OutputFilename.c_str());
if (!Out->good()) {
- std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+ cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
return 1;
}
@@ -164,22 +165,22 @@ int main(int argc, char **argv) {
return 1;
}
} catch (const std::string &Error) {
- std::cerr << argv[0] << ": " << Error << "\n";
- if (Out != &std::cout) {
+ cerr << argv[0] << ": " << Error << "\n";
+ if (Out != cout.stream()) {
delete Out; // Close the file
std::remove(OutputFilename.c_str()); // Remove the file, it's broken
}
return 1;
} catch (...) {
- std::cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
- if (Out != &std::cout) {
+ cerr << argv[0] << ": Unknown unexpected exception occurred.\n";
+ if (Out != cout.stream()) {
delete Out; // Close the file
std::remove(OutputFilename.c_str()); // Remove the file, it's broken
}
return 2;
}
- if (Out != &std::cout) {
+ if (Out != cout.stream()) {
delete Out; // Close the file
}
return 0;