Support for expanding the result of EXTRACT_ELEMENT.
[oota-llvm.git] / tools / llvm-as / llvm-as.cpp
index a7463b532ebe222ff42a15c16e2a683a83768d2a..d9fa1fa7f40a721c15926da5622c01c88110183c 100644 (file)
@@ -2,22 +2,21 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by the LLVM research group and is distributed under
-// the University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
 //  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"
@@ -41,23 +40,18 @@ static cl::opt<bool>
 Force("f", cl::desc("Overwrite output files"));
 
 static cl::opt<bool>
-DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
+DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false));
 
 static cl::opt<bool>
-NoCompress("disable-compression", cl::init(true),
-           cl::desc("Don't compress the generated bytecode"));
+DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
 
 static cl::opt<bool>
 DisableVerify("disable-verify", cl::Hidden,
               cl::desc("Do not run verifier on input LLVM (dangerous!)"));
 
-static cl::opt<bool>
-EnableBitcode("bitcode", cl::desc("Emit bitcode"));
-
-
 int main(int argc, char **argv) {
   llvm_shutdown_obj X;  // Call llvm_shutdown() on exit.
-  cl::ParseCommandLineOptions(argc, argv, " llvm .ll -> .bc assembler\n");
+  cl::ParseCommandLineOptions(argc, argv, "llvm .ll -> .bc assembler\n");
   sys::PrintStackTraceOnErrorSignal();
 
   int exitCode = 0;
@@ -134,14 +128,9 @@ int main(int argc, char **argv) {
       return 1;
     }
 
-    if (Force || !CheckBytecodeOutputToConsole(Out,true)) {
-      if (EnableBitcode) {
+    if (!DisableOutput)
+      if (Force || !CheckBitcodeOutputToConsole(Out,true))
         WriteBitcodeToFile(M.get(), *Out);
-      } else {
-        OStream L(*Out);
-        WriteBytecodeToFile(M.get(), L, !NoCompress);
-      }
-    }
   } catch (const std::string& msg) {
     cerr << argv[0] << ": " << msg << "\n";
     exitCode = 1;