Add creation of BasicObjCFoundationChecks when running GRSimpleVals from the driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48886 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
index b6e6b50..520f624 100644
--- a/lib/Analysis/GRSimpleVals.cpp
+++ b/lib/Analysis/GRSimpleVals.cpp
@@ -14,6 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "GRSimpleVals.h"
+#include "BasicObjCFoundationChecks.h"
 #include "clang/Analysis/PathSensitive/ValueState.h"
 #include "clang/Basic/Diagnostic.h"
 #include <sstream>
@@ -103,14 +104,19 @@
 unsigned RunGRSimpleVals(CFG& cfg, Decl& CD, ASTContext& Ctx,
                          Diagnostic& Diag, bool Visualize, bool TrimGraph) {
   
-  if (Diag.hasErrorOccurred())
-    return 0;
-  
   GRCoreEngine<GRExprEngine> Eng(cfg, CD, Ctx);
   GRExprEngine* CheckerState = &Eng.getCheckerState();
+  
+  // Set base transfer functions.
   GRSimpleVals GRSV;
   CheckerState->setTransferFunctions(GRSV);
   
+  // Add extra checkers.
+  llvm::OwningPtr<GRSimpleAPICheck> FoundationCheck(
+    CreateBasicObjCFoundationChecks(Ctx, &CheckerState->getStateManager()));
+  
+  CheckerState->AddObjCMessageExprCheck(FoundationCheck.get());
+  
   // Execute the worklist algorithm.
   Eng.ExecuteWorkList(100000);