[llvm-commits] CVS: llvm/tools/gccas/gccas.cpp

Bill Wendling isanbard at gmail.com
Tue Nov 28 16:20:29 PST 2006



Changes in directory llvm/tools/gccas:

gccas.cpp updated: 1.120 -> 1.121
---
Log message:

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.


---
Diffs of the changes:  (+8 -6)

 gccas.cpp |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)


Index: llvm/tools/gccas/gccas.cpp
diff -u llvm/tools/gccas/gccas.cpp:1.120 llvm/tools/gccas/gccas.cpp:1.121
--- llvm/tools/gccas/gccas.cpp:1.120	Wed Nov 22 17:49:16 2006
+++ llvm/tools/gccas/gccas.cpp	Tue Nov 28 18:19:40 2006
@@ -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 @@
     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 @@
 
 
     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 @@
     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 @@
     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;
 }






More information about the llvm-commits mailing list