aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/scan-build15
1 files changed, 9 insertions, 6 deletions
diff --git a/utils/scan-build b/utils/scan-build
index 8a13c6d3ff..27883f0d86 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -81,18 +81,21 @@ sub DieDiag {
# Some initial preprocessing of Clang options.
##----------------------------------------------------------------------------##
+# First, look for 'clang-cc' in libexec.
my $ClangSB = Cwd::realpath("$RealBin/libexec/clang-cc");
-
-# Also look for 'clang-cc' in the same directory as scan-build.
+# Second, look for 'clang-cc' in the same directory as scan-build.
if (!defined $ClangSB || ! -x $ClangSB) {
$ClangSB = Cwd::realpath("$RealBin/clang-cc");
}
-
-my $Clang = $ClangSB;
-
+# Third, look for 'clang-cc' in ../libexec
if (!defined $ClangSB || ! -x $ClangSB) {
- $Clang = "clang-cc";
+ $ClangSB = Cwd::realpath("$RealBin/../libexec/clang-cc");
}
+# Finally, default to looking for 'clang-cc' in the path.
+if (!defined $ClangSB || ! -x $ClangSB) {
+ $ClangSB = "clang-cc";
+}
+my $Clang = $ClangSB;
my %AvailableAnalyses;