Refactored all logic to run the GRSimpleVals and CFRef checker into a common
code path in the clang driver.

Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49500 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 6c82f19..4c8a352 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -122,11 +122,9 @@
                         "Flag warnings of stores to dead variables."),
              clEnumValN(WarnUninitVals, "warn-uninit-values",
                         "Flag warnings of uses of unitialized variables."),
-             clEnumValN(AnalysisGRSimpleVals, "grsimple",
+             clEnumValN(AnalysisGRSimpleVals, "checker-simple",
                         "Perform path-sensitive constant propagation."),
-             clEnumValN(AnalysisGRSimpleValsView, "grsimple-view",
-                        "View results of path-sensitive constant propagation."),
-             clEnumValN(CheckerCFRef, "check-cfref",
+             clEnumValN(CheckerCFRef, "checker-cfref",
                         "Run the Core Foundation reference count checker."),
              clEnumValN(TestSerialization, "test-pickling",
                         "Run prototype serialization code."),
@@ -153,6 +151,10 @@
 VerifyDiagnostics("verify",
                   llvm::cl::desc("Verify emitted diagnostics and warnings."));
 
+static llvm::cl::opt<bool>
+VisualizeEG("visualize-egraph",
+            llvm::cl::desc("Display static analysis Exploded Graph."));
+
 static llvm::cl::opt<std::string>
 HTMLDiag("html-diags",
          llvm::cl::desc("Generate HTML to report diagnostics"),
@@ -480,10 +482,9 @@
                 llvm::cl::desc("Run analysis on specific function."));
 
 static llvm::cl::opt<bool>
-TrimGraph("trim-path-graph",
+TrimGraph("trim-egraph",
       llvm::cl::desc("Only show error-related paths in the analysis graph."));
 
-
 //===----------------------------------------------------------------------===//
 // Target Triple Processing.
 //===----------------------------------------------------------------------===//
@@ -1052,14 +1053,12 @@
       return CreateUnitValsChecker(Diag);
       
     case AnalysisGRSimpleVals:
-      return CreateGRSimpleVals(Diag, AnalyzeSpecificFunction, OutputFile);
-      
-    case AnalysisGRSimpleValsView:
       return CreateGRSimpleVals(Diag, AnalyzeSpecificFunction, OutputFile,
-                                true, TrimGraph);
+                                VisualizeEG, TrimGraph);
       
     case CheckerCFRef:
-      return CreateCFRefChecker(Diag, AnalyzeSpecificFunction, OutputFile);
+      return CreateCFRefChecker(Diag, AnalyzeSpecificFunction, OutputFile,
+                                VisualizeEG, TrimGraph);
       
     case TestSerialization:
       return CreateSerializationTest(Diag, FileMgr, LangOpts);