Split MCEELFStreamer and ELFObjectWriter into .h and .cpp files, so that other compon...
[oota-llvm.git] / lib / CompilerDriver / Action.cpp
index 54b55d0d42f45765decbe839a0ff28ddae14ba5f..a8d625c7ac04ce431bf560c24d57e6da99e86089 100644 (file)
@@ -18,8 +18,8 @@
 
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/SystemUtils.h"
-#include "llvm/System/Program.h"
-#include "llvm/System/TimeValue.h"
+#include "llvm/Support/Program.h"
+#include "llvm/Support/TimeValue.h"
 
 #include <stdexcept>
 #include <string>
@@ -56,8 +56,9 @@ namespace {
   int ExecuteProgram (const std::string& name, const StrVector& args) {
     sys::Path prog(name);
 
-    if (!prog.isAbsolute()) {
-      prog = FindExecutable(name, ProgramName, (void *)(intptr_t)&Main);
+    if (sys::path::is_relative(prog.str())) {
+      prog = PrependMainExecutablePath(name, ProgramName,
+                                       (void *)(intptr_t)&Main);
 
       if (!prog.canExecute()) {
         prog = sys::Program::FindProgramByName(name);