[cfe-commits] r49073 - /cfe/trunk/utils/scan-build

Ted Kremenek kremenek at apple.com
Tue Apr 1 21:43:42 PDT 2008


Author: kremenek
Date: Tue Apr  1 23:43:42 2008
New Revision: 49073

URL: http://llvm.org/viewvc/llvm-project?rev=49073&view=rev
Log:
Added special handling when the build command is "gcc", "cc", or "llvm-gcc";
in these cases we directly call ccc-analyzer.

Modified:
    cfe/trunk/utils/scan-build

Modified: cfe/trunk/utils/scan-build
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/scan-build?rev=49073&r1=49072&r2=49073&view=diff

==============================================================================
--- cfe/trunk/utils/scan-build (original)
+++ cfe/trunk/utils/scan-build Tue Apr  1 23:43:42 2008
@@ -142,6 +142,24 @@
 }
 
 ##----------------------------------------------------------------------------##
+# 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 @@
   --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 @@
 
 # Run the build.
 
-system(@ARGV);
+RunBuildCommand(\@ARGV);
 
 # Postprocess the HTML directory.
 





More information about the cfe-commits mailing list