Support for expanding the result of EXTRACT_ELEMENT.
[oota-llvm.git] / tools / llvm-as / llvm-as.cpp
index e4c7344776ba5791dffa6767b7423cf18a55fc12..d9fa1fa7f40a721c15926da5622c01c88110183c 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     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.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -39,6 +39,9 @@ OutputFilename("o", cl::desc("Override output filename"),
 static cl::opt<bool>
 Force("f", cl::desc("Overwrite output files"));
 
+static cl::opt<bool>
+DisableOutput("disable-output", cl::desc("Disable output"), cl::init(false));
+
 static cl::opt<bool>
 DumpAsm("d", cl::desc("Print assembly as parsed"), cl::Hidden);
 
@@ -48,7 +51,7 @@ DisableVerify("disable-verify", cl::Hidden,
 
 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;
@@ -125,8 +128,9 @@ int main(int argc, char **argv) {
       return 1;
     }
 
-    if (Force || !CheckBytecodeOutputToConsole(Out,true))
-      WriteBitcodeToFile(M.get(), *Out);
+    if (!DisableOutput)
+      if (Force || !CheckBitcodeOutputToConsole(Out,true))
+        WriteBitcodeToFile(M.get(), *Out);
   } catch (const std::string& msg) {
     cerr << argv[0] << ": " << msg << "\n";
     exitCode = 1;