The functions in Signal.h are now in the llvm::sys namespace - adjust
[oota-llvm.git] / tools / llvm-dis / llvm-dis.cpp
index c355434b4445787a3483d0028822b17899cc7fba..ac8101b6c425c1fd29ac5eb2c933d8bb1c2bebf7 100644 (file)
@@ -13,7 +13,6 @@
 //                            to the x.ll file.
 //  Options:
 //      --help   - Output information about command line switches
-//       -c      - Print C code instead of LLVM assembly
 //
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Bytecode/Reader.h"
 #include "llvm/Assembly/PrintModulePass.h"
 #include "Support/CommandLine.h"
-#include "Support/Signals.h"
+#include "llvm/System/Signals.h"
 #include <fstream>
 #include <memory>
 
-// OutputMode - The different orderings to print basic blocks in...
-enum OutputMode {
-  LLVM = 0,           // Generate LLVM assembly (the default)
-  c,                  // Generate C code
-};
-
 using namespace llvm;
 
 static cl::opt<std::string>
@@ -44,20 +37,19 @@ OutputFilename("o", cl::desc("Override output filename"),
 static cl::opt<bool>
 Force("f", cl::desc("Overwrite output files"));
 
-static cl::opt<enum OutputMode>
-WriteMode(cl::desc("Specify the output format:"),
-          cl::values(clEnumValN(LLVM, "llvm", "Output LLVM assembly"),
-                     clEnumVal(c, "Output C code for program"),
-                    0),
-          cl::ReallyHidden);
+static cl::opt<bool>
+CWriteMode("c", cl::desc("Obsolete option, do not use"), cl::ReallyHidden);
 
 int main(int argc, char **argv) {
   cl::ParseCommandLineOptions(argc, argv, " llvm .bc -> .ll disassembler\n");
+  sys::PrintStackTraceOnErrorSignal();
+
   std::ostream *Out = &std::cout;  // Default to printing to stdout...
   std::string ErrorMessage;
 
-  if (WriteMode == c) {
-    std::cerr << "ERROR: llvm-dis no longer contains the C backend.  Use 'llc -march=c' instead!\n";
+  if (CWriteMode) {
+    std::cerr << "ERROR: llvm-dis no longer contains the C backend. "
+              << "Use 'llc -march=c' instead!\n";
     exit(1);
   }
 
@@ -103,7 +95,7 @@ int main(int argc, char **argv) {
 
         // Make sure that the Out file gets unlinked from the disk if we get a
         // SIGINT
-        RemoveFileOnSignal(OutputFilename);
+        sys::RemoveFileOnSignal(OutputFilename);
       }
     }
   }