Add store option to scan-build and ccc-analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58248 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/utils/scan-build b/utils/scan-build
index ef1b2c1..cd5a307 100755
--- a/utils/scan-build
+++ b/utils/scan-build
@@ -808,6 +808,11 @@
 
  -analyze-headers - Also analyze functions in #included files.
 
+ -store [model] - Specify the store model used by the analyzer. By default,
+                  the 'basic' store model is used. 'region' specifies a field-
+                  sensitive store model. Be warned that the 'region' model
+                  is still in very early testing phase and may often crash.
+
  -o             - Target directory for HTML report files.  Subdirectories
                   will be created as needed to represent separate "runs" of
                   the analyzer.  If this option is not specified, a directory
@@ -918,6 +923,7 @@
 my $ViewResults  = 0;  # View results when the build terminates.
 my $ExitStatusFoundBugs = 0; # Exit status reflects whether bugs were found
 my @AnalysesToRun;
+my $StoreModel;
 
 if (!@ARGV) {
   DisplayHelp();
@@ -1030,6 +1036,12 @@
     $ExitStatusFoundBugs = 1;
     next;
   }
+
+  if ($arg eq "-store") {
+    shift @ARGV;
+    $StoreModel = '-analyzer-store-' . shift @ARGV;
+    next;
+  }
   
   DieDiag("unrecognized option '$arg'\n") if ($arg =~ /^-/);
   
@@ -1094,6 +1106,10 @@
 
 $ENV{'CCC_ANALYZER_ANALYSIS'} = join ' ',@AnalysesToRun;
 
+if ($StoreModel) {
+  $ENV{'CCC_ANALYZER_STORE_MODEL'} = $StoreModel;
+}
+
 # Run the build.
 my $ExitStatus = RunBuildCommand(\@ARGV, $IgnoreErrors, $Cmd);