aboutsummaryrefslogtreecommitdiff
path: root/tools/gccas/gccas.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2006-11-29 00:19:40 +0000
committerBill Wendling <isanbard@gmail.com>2006-11-29 00:19:40 +0000
commit68fe61d6a165ea6090008e281330895a21607daf (patch)
tree2e0cc1cbd16099aed908dbb3ecda16cf57d04300 /tools/gccas/gccas.cpp
parenta5b31ca85686062408bca0f0a8aa43f9fe58e644 (diff)
Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to functions expecting an LLVM stream. This should be fixed in the future. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/gccas/gccas.cpp')
-rw-r--r--tools/gccas/gccas.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/gccas/gccas.cpp b/tools/gccas/gccas.cpp
index c46b29608a..eda7d9b5b5 100644
--- a/tools/gccas/gccas.cpp
+++ b/tools/gccas/gccas.cpp
@@ -23,10 +23,11 @@
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/Streams.h"
#include "llvm/System/Signals.h"
+#include <iostream>
#include <memory>
#include <fstream>
-
using namespace llvm;
namespace {
@@ -140,7 +141,7 @@ int main(int argc, char **argv) {
ParseError Err;
std::auto_ptr<Module> M(ParseAssemblyFile(InputFilename,&Err));
if (M.get() == 0) {
- std::cerr << argv[0] << ": " << Err.getMessage() << "\n";
+ llvm_cerr << argv[0] << ": " << Err.getMessage() << "\n";
return 1;
}
@@ -175,7 +176,7 @@ int main(int argc, char **argv) {
if (!Out->good()) {
- std::cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
+ llvm_cerr << argv[0] << ": error opening " << OutputFilename << "!\n";
return 1;
}
@@ -194,7 +195,8 @@ int main(int argc, char **argv) {
Passes.add(createVerifierPass());
// Write bytecode to file...
- Passes.add(new WriteBytecodePass(Out,false,!NoCompress));
+ llvm_ostream L(*Out);
+ Passes.add(new WriteBytecodePass(&L,false,!NoCompress));
// Run our queue of passes all at once now, efficiently.
Passes.run(*M.get());
@@ -202,9 +204,9 @@ int main(int argc, char **argv) {
if (Out != &std::cout) delete Out;
return 0;
} catch (const std::string& msg) {
- std::cerr << argv[0] << ": " << msg << "\n";
+ llvm_cerr << argv[0] << ": " << msg << "\n";
} catch (...) {
- std::cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
+ llvm_cerr << argv[0] << ": Unexpected unknown exception occurred.\n";
}
return 1;
}