Added special handling when the build command is "gcc", "cc", or "llvm-gcc";
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
diff --git a/utils/scan-build b/utils/scan-build
index a9b454a..0822232 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -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.
+  --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.
-
+  -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.