]> granicus.if.org Git - clang/commitdiff
Added special handling when the build command is "gcc", "cc", or "llvm-gcc";
authorTed Kremenek <kremenek@apple.com>
Wed, 2 Apr 2008 04:43:42 +0000 (04:43 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 2 Apr 2008 04:43:42 +0000 (04:43 +0000)
in these cases we directly call ccc-analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49073 91177308-0d34-0410-b5e6-96231b3b80d8

utils/scan-build

index a9b454ab99e41642cb3bacd6040ba051ce9d73e5..0822232e1b1c0c323d38db3867ece265d41fe6c1 100755 (executable)
@@ -141,6 +141,24 @@ sub Postprocess {
 
 }
 
+##----------------------------------------------------------------------------##
+# RunBuildCommand - Run the build command.
+##----------------------------------------------------------------------------##
+
+sub RunBuildCommand {
+  
+  my $Args = shift;
+  my $Cmd = $Args->[0];
+  
+  if ($Cmd =~ /gcc/ or $Cmd eq "cc" or $Cmd =~ /"llvm-gcc"/) {
+    shift @$Args;
+    unshift @$Args, "ccc-analyzer"
+  }
+  
+  system(@$Args);
+}
+
+
 ##----------------------------------------------------------------------------##
 # DisplayHelp - Utility function to display all help options.
 ##----------------------------------------------------------------------------##
@@ -161,13 +179,12 @@ OPTIONS:
   --help
   
   -k            - Add "keep on going option" to the specified build command.
-  --keep-going    This command currently supports "make" and "xcodebuild."  You
-                  can also directly specify the corresponding option to the
-                  build command.
-
-  -v            - Verbose output from $Prog and the analyzer.  A second
-                  "-v" increases verbosity.
+  --keep-going    This command currently supports make and xcodebuild.
+                  This is a helper option; one can specify the arguments
+                  directly as build options.
 
+  -v            - Verbose output from $Prog and the analyzer.
+                  A second "-v" increases verbosity.
 
 BUILD OPTIONS
 
@@ -271,7 +288,7 @@ if ($Verbose >= 2) {
 
 # Run the build.
 
-system(@ARGV);
+RunBuildCommand(\@ARGV);
 
 # Postprocess the HTML directory.