From: Ted Kremenek Date: Mon, 30 Jun 2008 18:18:16 +0000 (+0000) Subject: When inspecting the build command, strip off the preceding path to the build command. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3301cb103d5f32056d62f13bde036988f7cf1330;p=clang When inspecting the build command, strip off the preceding path to the build command. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52913 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/scan-build b/utils/scan-build index e305ee50a7..f881cc8ea6 100755 --- a/utils/scan-build +++ b/utils/scan-build @@ -534,6 +534,11 @@ sub RunBuildCommand { my $Cmd = $Args->[0]; my $CCAnalyzer = shift; + # Get only the part of the command after the last '/'. + if ($Cmd =~ /\/([^\/]+)$/) { + $Cmd = $1; + } + if ($Cmd eq "gcc" or $Cmd eq "cc" or $Cmd eq "llvm-gcc") { shift @$Args; unshift @$Args, $CCAnalyzer;