summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/Driver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r--clang/lib/Driver/Driver.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 6c0668bff6d..85debe8bb73 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -26,6 +26,7 @@
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/System/Path.h"
+#include "llvm/System/Program.h"
#include "InputInfo.h"
@@ -879,6 +880,11 @@ llvm::sys::Path Driver::GetProgramPath(const char *Name,
if (P.exists())
return P;
+ // Search path to increase accuracy of logging output.
+ P = llvm::sys::Program::FindProgramByName(Name);
+ if (!P.empty())
+ return P;
+
return llvm::sys::Path(Name);
}
OpenPOWER on IntegriCloud