]> granicus.if.org Git - clang/commitdiff
When inspecting the build command, strip off the preceding path to the build command.
authorTed Kremenek <kremenek@apple.com>
Mon, 30 Jun 2008 18:18:16 +0000 (18:18 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 30 Jun 2008 18:18:16 +0000 (18:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52913 91177308-0d34-0410-b5e6-96231b3b80d8

utils/scan-build

index e305ee50a7e14ecd8933ccbe7239d335b24dda87..f881cc8ea67f742178352a86020b32c66bbd4d33 100755 (executable)
@@ -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;