aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CompilerDriver
diff options
context:
space:
mode:
authorMikhail Glushenkov <foldr@codedgers.com>2010-11-02 20:47:41 +0000
committerMikhail Glushenkov <foldr@codedgers.com>2010-11-02 20:47:41 +0000
commit6674b77adab93f5c36517ffa4cbcf9b242eea1e9 (patch)
treed319739da2c6ee462a499f9f3616ba9c789a77be /lib/CompilerDriver
parentd138d7034e8dcfbb55683116a854a1e42d6879a4 (diff)
downloadexternal_llvm-6674b77adab93f5c36517ffa4cbcf9b242eea1e9.zip
external_llvm-6674b77adab93f5c36517ffa4cbcf9b242eea1e9.tar.gz
external_llvm-6674b77adab93f5c36517ffa4cbcf9b242eea1e9.tar.bz2
llvmc: Fix tool finding logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118056 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CompilerDriver')
-rw-r--r--lib/CompilerDriver/Action.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CompilerDriver/Action.cpp b/lib/CompilerDriver/Action.cpp
index 3503bd3..54b55d0 100644
--- a/lib/CompilerDriver/Action.cpp
+++ b/lib/CompilerDriver/Action.cpp
@@ -53,18 +53,18 @@ namespace {
#endif
}
- int ExecuteProgram (const std::string& name,
- const StrVector& args) {
+ int ExecuteProgram (const std::string& name, const StrVector& args) {
sys::Path prog(name);
- if (!prog.isAbsolute())
+ if (!prog.isAbsolute()) {
prog = FindExecutable(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()) {