Do use the actual ocaml stdlib (not the install dir) to find the
[oota-llvm.git] / tools / llvm-as / llvm-as.cpp
index dd29bc19e83d7b47ba57be2585d4711cec8c106f..41b6846fe1cb94ab05f2dfb69590524609288221 100644 (file)
@@ -9,16 +9,16 @@
 //
 //  This utility may be invoked in the following manner:
 //   llvm-as --help         - Output information about command line switches
-//   llvm-as [options]      - Read LLVM asm from stdin, write bytecode to stdout
-//   llvm-as [options] x.ll - Read LLVM asm from the x.ll file, write bytecode
+//   llvm-as [options]      - Read LLVM asm from stdin, write bitcode to stdout
+//   llvm-as [options] x.ll - Read LLVM asm from the x.ll file, write bitcode
 //                            to the x.bc file.
 //
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Module.h"
 #include "llvm/Assembly/Parser.h"
-#include "llvm/Bytecode/Writer.h"
 #include "llvm/Analysis/Verifier.h"
+#include "llvm/Bitcode/ReaderWriter.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ManagedStatic.h"
 #include "llvm/Support/Streams.h"
@@ -42,10 +42,6 @@ Force("f", cl::desc("Overwrite output files"));
 static cl::opt<bool>
 DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
 
-static cl::opt<bool>
-NoCompress("disable-compression", cl::init(false),
-           cl::desc("Don't compress the generated bytecode"));
-
 static cl::opt<bool>
 DisableVerify("disable-verify", cl::Hidden,
               cl::desc("Do not run verifier on input LLVM (dangerous!)"));
@@ -129,10 +125,8 @@ int main(int argc, char **argv) {
       return 1;
     }
 
-    if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
-      OStream L(*Out);
-      WriteBytecodeToFile(M.get(), L, !NoCompress);
-    }
+    if (Force || !CheckBitcodeOutputToConsole(Out,true))
+      WriteBitcodeToFile(M.get(), *Out);
   } catch (const std::string& msg) {
     cerr << argv[0] << ": " << msg << "\n";
     exitCode = 1;