Fix register printing in disassembling of push/pop of segment registers and in/out...
[oota-llvm.git] / tools / bugpoint / OptimizerDriver.cpp
index d28ce79877a5e761c84a3439a6cc4b00c552532a..336c83d7b1f39bd864a075624c9fdc6547ea4c97 100644 (file)
@@ -26,8 +26,8 @@
 #include "llvm/Support/SystemUtils.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ToolOutputFile.h"
-#include "llvm/System/Path.h"
-#include "llvm/System/Program.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Support/Program.h"
 
 #define DONT_GET_PLUGIN_LOADER_OPTION
 #include "llvm/Support/PluginLoader.h"
@@ -89,7 +89,8 @@ void BugDriver::EmitProgressBitcode(const Module *M,
   outs() << getPassesString(PassesToRun) << "\n";
 }
 
-cl::opt<bool> SilencePasses("silence-passes", cl::desc("Suppress output of running passes (both stdout and stderr)"));
+cl::opt<bool> SilencePasses("silence-passes",
+        cl::desc("Suppress output of running passes (both stdout and stderr)"));
 
 static cl::list<std::string> OptArgs("opt-args", cl::Positional,
                                      cl::desc("<opt arguments>..."),
@@ -144,7 +145,8 @@ bool BugDriver::runPasses(Module *Program,
     return 1;
   }
 
-  sys::Path tool = FindExecutable("opt", getToolName(), (void*)"opt");
+  sys::Path tool = PrependMainExecutablePath("opt", getToolName(),
+                                             (void*)"opt");
   if (tool.empty()) {
     errs() << "Cannot find `opt' in executable directory!\n";
     return 1;
@@ -221,7 +223,7 @@ bool BugDriver::runPasses(Module *Program,
       if (result == -1)
         outs() << "Execute failed: " << ErrMsg << "\n";
       else
-        outs() << "Crashed with signal #" << abs(result) << "\n";
+        outs() << "Crashed: " << ErrMsg << "\n";
     }
     if (result & 0x01000000)
       outs() << "Dumped core\n";