summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/SystemUtils.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-01 21:36:28 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-01 21:36:28 +0000
commit4aef67c99da6ab6f21042d56ff80dc846087bb71 (patch)
tree9f4a36800df8f9031ed873300ff4a07be9bca830 /llvm/lib/Support/SystemUtils.cpp
parentf206e4444b3d56a75fc379c9c756f96e11f5ccab (diff)
downloadbcm5719-llvm-4aef67c99da6ab6f21042d56ff80dc846087bb71.tar.gz
bcm5719-llvm-4aef67c99da6ab6f21042d56ff80dc846087bb71.zip
Tweak FindExecutable so that relative executable paths work as well.
llvm-svn: 74645
Diffstat (limited to 'llvm/lib/Support/SystemUtils.cpp')
-rw-r--r--llvm/lib/Support/SystemUtils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Support/SystemUtils.cpp b/llvm/lib/Support/SystemUtils.cpp
index 5dcd3347258..c8c323876bf 100644
--- a/llvm/lib/Support/SystemUtils.cpp
+++ b/llvm/lib/Support/SystemUtils.cpp
@@ -43,9 +43,10 @@ bool llvm::CheckBitcodeOutputToConsole(std::ostream* stream_to_check,
#undef FindExecutable // needed on windows :(
sys::Path llvm::FindExecutable(const std::string &ExeName,
const std::string &ProgramPath) {
- // First check if the given name is a fully qualified path to an executable
+ // First check if the given name is already a valid path to an executable.
sys::Path Result(ExeName);
- if (Result.isAbsolute() && Result.canExecute())
+ Result.makeAbsolute();
+ if (Result.canExecute())
return Result;
// Otherwise check the directory that the calling program is in. We can do
OpenPOWER on IntegriCloud