scan-build now recognizes when the user is directly invoking gcc for:
(a) different versions of gcc (e.g., a suffix '-4.2')
(b) different paths for gcc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59578 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/scan-build b/utils/scan-build
index 03d8f4d..f1e26b7 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -793,8 +793,15 @@
$Cmd = $1;
}
- if ($Cmd eq "gcc" or $Cmd eq "cc" or $Cmd eq "llvm-gcc"
- or $Cmd eq "ccc-analyzer") {
+ if ($Cmd =~ /(.*\/?gcc[^\/]*$)/ or
+ $Cmd =~ /(.*\/?cc[^\/]*$)/ or
+ $Cmd =~ /(.*\/?llvm-gcc[^\/]*$)/ or
+ $Cmd =~ /(.*\/?ccc-analyzer[^\/]*$)/) {
+
+ if (!($Cmd =~ /ccc-analyzer/) and !defined $ENV{"CCC_CC"}) {
+ $ENV{"CCC_CC"} = $1;
+ }
+
shift @$Args;
unshift @$Args, $CCAnalyzer;
}