[analyzer] Remove the last dependency on CheckerContext::getNodeBuilder() as well as the method itself.

Checkers should not directly access NodeBuilder, nodes can be created by calling the CheckerContext's generateNode() methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141249 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
index 417bea9..19daaa5 100644
--- a/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+++ b/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
@@ -78,7 +78,6 @@
   }
 
   ExplodedNodeSet &getNodeSet() { return Dst; }
-  StmtNodeBuilder &getNodeBuilder() { return B; }
   ExplodedNode *&getPredecessor() { return Pred; }
   const ProgramState *getState() { return ST ? ST : Pred->getState(); }
   const Stmt *getStmt() const { return statement; }
diff --git a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
index b31c4a7..58bd7ec 100644
--- a/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
@@ -43,22 +43,20 @@
 /// Wrapper around different kinds of node builder, so that helper functions
 /// can have a common interface.
 class GenericNodeBuilderRefCount {
-  StmtNodeBuilder *SNB;
-  const Stmt *S;
+  CheckerContext *C;
   const ProgramPointTag *tag;
   EndOfFunctionNodeBuilder *ENB;
 public:
-  GenericNodeBuilderRefCount(StmtNodeBuilder &snb, const Stmt *s,
-                     const ProgramPointTag *t)
-  : SNB(&snb), S(s), tag(t), ENB(0) {}
+  GenericNodeBuilderRefCount(CheckerContext &c,
+                             const ProgramPointTag *t)
+  : C(&c), tag(t), ENB(0) {}
 
   GenericNodeBuilderRefCount(EndOfFunctionNodeBuilder &enb)
-  : SNB(0), S(0), tag(0), ENB(&enb) {}
+  : C(0), tag(0), ENB(&enb) {}
 
   ExplodedNode *MakeNode(const ProgramState *state, ExplodedNode *Pred) {
-    if (SNB)
-      return SNB->generateNode(PostStmt(S, Pred->getLocationContext(), tag),
-                               state, Pred);
+    if (C)
+      return C->generateNode(state, Pred, tag, false);
 
     assert(ENB);
     return ENB->generateNode(state, Pred);
@@ -3110,7 +3108,7 @@
   // Update the autorelease counts.
   static SimpleProgramPointTag
          AutoreleaseTag("RetainCountChecker : Autorelease");
-  GenericNodeBuilderRefCount Bd(C.getNodeBuilder(), S, &AutoreleaseTag);
+  GenericNodeBuilderRefCount Bd(C, &AutoreleaseTag);
   llvm::tie(Pred, state) = handleAutoreleaseCounts(state, Bd, Pred,
                                                    C.getEngine(), Sym, X);
 
@@ -3463,9 +3461,7 @@
 
 void RetainCountChecker::checkDeadSymbols(SymbolReaper &SymReaper,
                                           CheckerContext &C) const {
-  StmtNodeBuilder &Builder = C.getNodeBuilder();
   ExprEngine &Eng = C.getEngine();
-  const Stmt *S = C.getStmt();
   ExplodedNode *Pred = C.getPredecessor();
 
   const ProgramState *state = C.getState();
@@ -3478,7 +3474,7 @@
     if (const RefVal *T = B.lookup(Sym)){
       // Use the symbol as the tag.
       // FIXME: This might not be as unique as we would like.
-      GenericNodeBuilderRefCount Bd(Builder, S, getDeadSymbolTag(Sym));
+      GenericNodeBuilderRefCount Bd(C, getDeadSymbolTag(Sym));
       llvm::tie(Pred, state) = handleAutoreleaseCounts(state, Bd, Pred, Eng,
                                                        Sym, *T);
       if (!state)
@@ -3496,7 +3492,7 @@
   }
 
   {
-    GenericNodeBuilderRefCount Bd(Builder, S, this);
+    GenericNodeBuilderRefCount Bd(C, this);
     Pred = processLeaks(state, Leaked, Bd, Eng, Pred);
   }