projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Delete dead code after rematerializing.
[oota-llvm.git]
/
lib
/
CompilerDriver
/
Action.cpp
diff --git
a/lib/CompilerDriver/Action.cpp
b/lib/CompilerDriver/Action.cpp
index 3503bd39db2714a6b8b6d39be5d15f6c353681e0..a8d625c7ac04ce431bf560c24d57e6da99e86089 100644
(file)
--- a/
lib/CompilerDriver/Action.cpp
+++ b/
lib/CompilerDriver/Action.cpp
@@
-18,8
+18,8
@@
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/SystemUtils.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/SystemUtils.h"
-#include "llvm/S
ystem
/Program.h"
-#include "llvm/S
ystem
/TimeValue.h"
+#include "llvm/S
upport
/Program.h"
+#include "llvm/S
upport
/TimeValue.h"
#include <stdexcept>
#include <string>
#include <stdexcept>
#include <string>
@@
-53,18
+53,19
@@
namespace {
#endif
}
#endif
}
- int ExecuteProgram (const std::string& name,
- const StrVector& args) {
+ int ExecuteProgram (const std::string& name, const StrVector& args) {
sys::Path prog(name);
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.isEmpty()) {
- prog = sys::Program::FindProgramByName(name);
- if (prog.isEmpty()) {
- PrintError("Can't find program '" + name + "'");
- return -1;
+ if (!prog.canExecute()) {
+ prog = sys::Program::FindProgramByName(name);
+ if (prog.isEmpty()) {
+ PrintError("Can't find program '" + name + "'");
+ return -1;
+ }
}
}
if (!prog.canExecute()) {
}
}
if (!prog.canExecute()) {