[cfe-commits] r142847 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h lib/StaticAnalyzer/Core/CheckerManager.cpp lib/StaticAnalyzer/Core/ExprEngine.cpp lib/StaticAnalyzer/Core/ExprEngineC.cpp lib/StaticAnalyzer/Core/ExprEngineCXX.cpp lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

Anna Zaks ganna at apple.com
Mon Oct 24 14:19:48 PDT 2011


Author: zaks
Date: Mon Oct 24 16:19:48 2011
New Revision: 142847

URL: http://llvm.org/viewvc/llvm-project?rev=142847&view=rev
Log:
[analyzer] Completely remove the global Builder object.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
    cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h?rev=142847&r1=142846&r2=142847&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h Mon Oct 24 16:19:48 2011
@@ -47,10 +47,6 @@
   /// G - the simulation graph.
   ExplodedGraph& G;
 
-  /// Builder - The current StmtNodeBuilder which is used when building the
-  ///  nodes for a given statement.
-  StmtNodeBuilder* Builder;
-
   /// StateMgr - Object that manages the data for all created states.
   ProgramStateManager StateMgr;
 
@@ -118,7 +114,6 @@
 
   BugReporter& getBugReporter() { return BR; }
 
-  StmtNodeBuilder &getBuilder() { assert(Builder); return *Builder; }
   const NodeBuilderContext &getBuilderContext() {
     assert(currentBuilderContext);
     return *currentBuilderContext;
@@ -155,11 +150,13 @@
   void ProcessImplicitDtor(const CFGImplicitDtor D, ExplodedNode *Pred);
 
   void ProcessAutomaticObjDtor(const CFGAutomaticObjDtor D, 
-                               StmtNodeBuilder &builder, ExplodedNode *Pred);
-  void ProcessBaseDtor(const CFGBaseDtor D, StmtNodeBuilder &builder);
-  void ProcessMemberDtor(const CFGMemberDtor D, StmtNodeBuilder &builder);
+                               ExplodedNode *Pred, ExplodedNodeSet &Dst);
+  void ProcessBaseDtor(const CFGBaseDtor D,
+                       ExplodedNode *Pred, ExplodedNodeSet &Dst);
+  void ProcessMemberDtor(const CFGMemberDtor D,
+                         ExplodedNode *Pred, ExplodedNodeSet &Dst);
   void ProcessTemporaryDtor(const CFGTemporaryDtor D, 
-                            StmtNodeBuilder &builder);
+                            ExplodedNode *Pred, ExplodedNodeSet &Dst);
 
   /// Called by CoreEngine when processing the entrance of a CFGBlock.
   virtual void processCFGBlockEntrance(ExplodedNodeSet &dstNodes,
@@ -243,11 +240,6 @@
   const CoreEngine &getCoreEngine() const { return Engine; }
 
 public:
-  ExplodedNode *MakeNode(ExplodedNodeSet &Dst, const Stmt *S, 
-                         ExplodedNode *Pred, const ProgramState *St,
-                         ProgramPoint::Kind K = ProgramPoint::PostStmtKind,
-                         const ProgramPointTag *tag = 0);
-
   /// Visit - Transfer function logic for all statements.  Dispatches to
   ///  other functions that handle specific kinds of statements.
   void Visit(const Stmt *S, ExplodedNode *Pred, ExplodedNodeSet &Dst);

Modified: cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp?rev=142847&r1=142846&r2=142847&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp Mon Oct 24 16:19:48 2011
@@ -479,7 +479,6 @@
     
     // If none of the checkers evaluated the call, ask ExprEngine to handle it.
     if (!anyEvaluated) {
-      Eng.getBuilder().addNodes(Pred);
       if (defaultEval)
         defaultEval->expandGraph(Dst, Pred);
       else

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=142847&r1=142846&r2=142847&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Mon Oct 24 16:19:48 2011
@@ -56,7 +56,6 @@
     AnalysisDeclContexts(mgr.getAnalysisDeclContextManager()),
     Engine(*this),
     G(Engine.getGraph()),
-    Builder(NULL),
     StateMgr(getContext(), mgr.getStoreManagerCreator(),
              mgr.getConstraintManagerCreator(), G.getAllocator(),
              *this),
@@ -265,9 +264,6 @@
 
 void ExprEngine::ProcessStmt(const CFGStmt S,
                              ExplodedNode *Pred) {
-  ExplodedNodeSet TopDst;
-  StmtNodeBuilder builder(Pred, TopDst, currentStmtIdx, *currentBuilderContext);
-  Builder = &builder;
   // TODO: Use RAII to remove the unnecessary, tagged nodes.
   //RegisterCreatedNodes registerCreatedNodes(getGraph());
 
@@ -366,31 +362,33 @@
   CleanedState = NULL;
   EntryNode = NULL;
   currentStmt = 0;
-  Builder = NULL;
 }
 
 void ExprEngine::ProcessInitializer(const CFGInitializer Init,
-                                    ExplodedNode *pred) {
+                                    ExplodedNode *Pred) {
   ExplodedNodeSet Dst;
-  StmtNodeBuilder Bldr(pred, Dst, currentStmtIdx, *currentBuilderContext);
 
   // We don't set EntryNode and currentStmt. And we don't clean up state.
   const CXXCtorInitializer *BMI = Init.getInitializer();
-  const StackFrameContext *stackFrame = cast<StackFrameContext>(pred->getLocationContext());
-  const CXXConstructorDecl *decl = cast<CXXConstructorDecl>(stackFrame->getDecl());
+  const StackFrameContext *stackFrame =
+                           cast<StackFrameContext>(Pred->getLocationContext());
+  const CXXConstructorDecl *decl =
+                           cast<CXXConstructorDecl>(stackFrame->getDecl());
   const CXXThisRegion *thisReg = getCXXThisRegion(decl, stackFrame);
 
-  SVal thisVal = pred->getState()->getSVal(thisReg);
+  SVal thisVal = Pred->getState()->getSVal(thisReg);
 
   if (BMI->isAnyMemberInitializer()) {
-    ExplodedNodeSet Dst;
+    ExplodedNodeSet AfterEval;
 
     // Evaluate the initializer.
-    Visit(BMI->getInit(), pred, Dst);
+    Visit(BMI->getInit(), Pred, AfterEval);
 
-    for (ExplodedNodeSet::iterator I = Dst.begin(), E = Dst.end(); I != E; ++I){
-      ExplodedNode *Pred = *I;
-      const ProgramState *state = Pred->getState();
+    PureStmtNodeBuilder Bldr(AfterEval, Dst, *currentBuilderContext);
+    for (ExplodedNodeSet::iterator I = AfterEval.begin(),
+                                   E = AfterEval.end(); I != E; ++I){
+      ExplodedNode *P = *I;
+      const ProgramState *state = P->getState();
 
       const FieldDecl *FD = BMI->getAnyMember();
 
@@ -402,26 +400,24 @@
       PostInitializer PP(BMI, stackFrame);
       // Builder automatically add the generated node to the deferred set,
       // which are processed in the builder's dtor.
-      Bldr.generateNode(PP, state, Pred);
+      Bldr.generateNode(PP, P, state);
     }
-    return;
-  }
+  } else {
+    assert(BMI->isBaseInitializer());
 
-  assert(BMI->isBaseInitializer());
+    // Get the base class declaration.
+    const CXXConstructExpr *ctorExpr = cast<CXXConstructExpr>(BMI->getInit());
 
-  // Get the base class declaration.
-  const CXXConstructExpr *ctorExpr = cast<CXXConstructExpr>(BMI->getInit());
+    // Create the base object region.
+    SVal baseVal =
+        getStoreManager().evalDerivedToBase(thisVal, ctorExpr->getType());
+    const MemRegion *baseReg = baseVal.getAsRegion();
+    assert(baseReg);
 
-  // Create the base object region.
-  SVal baseVal = 
-    getStoreManager().evalDerivedToBase(thisVal, ctorExpr->getType());
-  const MemRegion *baseReg = baseVal.getAsRegion();
-  assert(baseReg);
-  Builder = &Bldr;
-  ExplodedNodeSet dst;
-  VisitCXXConstructExpr(ctorExpr, baseReg, pred, dst);
-  for (ExplodedNodeSet::iterator I = dst.begin(),
-                                 E = dst.end(); I != E; ++I) {
+    VisitCXXConstructExpr(ctorExpr, baseReg, Pred, Dst);
+  }
+  for (ExplodedNodeSet::iterator I = Dst.begin(),
+                                 E = Dst.end(); I != E; ++I) {
       GenerateAutoTransition(*I);
   }
 }
@@ -429,22 +425,18 @@
 void ExprEngine::ProcessImplicitDtor(const CFGImplicitDtor D,
                                      ExplodedNode *Pred) {
   ExplodedNodeSet Dst;
-  StmtNodeBuilder builder(Pred, Dst, currentStmtIdx, *currentBuilderContext);
-
-  Builder = &builder;
-
   switch (D.getKind()) {
   case CFGElement::AutomaticObjectDtor:
-    ProcessAutomaticObjDtor(cast<CFGAutomaticObjDtor>(D), builder, Pred);
+    ProcessAutomaticObjDtor(cast<CFGAutomaticObjDtor>(D), Pred, Dst);
     break;
   case CFGElement::BaseDtor:
-    ProcessBaseDtor(cast<CFGBaseDtor>(D), builder);
+    ProcessBaseDtor(cast<CFGBaseDtor>(D), Pred, Dst);
     break;
   case CFGElement::MemberDtor:
-    ProcessMemberDtor(cast<CFGMemberDtor>(D), builder);
+    ProcessMemberDtor(cast<CFGMemberDtor>(D), Pred, Dst);
     break;
   case CFGElement::TemporaryDtor:
-    ProcessTemporaryDtor(cast<CFGTemporaryDtor>(D), builder);
+    ProcessTemporaryDtor(cast<CFGTemporaryDtor>(D), Pred, Dst);
     break;
   default:
     llvm_unreachable("Unexpected dtor kind.");
@@ -456,11 +448,11 @@
   }
 }
 
-void ExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor dtor,
-                                         StmtNodeBuilder &builder,
-                                         ExplodedNode *pred) {
-  const ProgramState *state = pred->getState();
-  const VarDecl *varDecl = dtor.getVarDecl();
+void ExprEngine::ProcessAutomaticObjDtor(const CFGAutomaticObjDtor Dtor,
+                                         ExplodedNode *Pred,
+                                         ExplodedNodeSet &Dst) {
+  const ProgramState *state = Pred->getState();
+  const VarDecl *varDecl = Dtor.getVarDecl();
 
   QualType varType = varDecl->getType();
 
@@ -471,24 +463,21 @@
   assert(recordDecl && "get CXXRecordDecl fail");
   const CXXDestructorDecl *dtorDecl = recordDecl->getDestructor();
 
-  Loc dest = state->getLValue(varDecl, pred->getLocationContext());
+  Loc dest = state->getLValue(varDecl, Pred->getLocationContext());
 
-  ExplodedNodeSet dstSet;
   VisitCXXDestructor(dtorDecl, cast<loc::MemRegionVal>(dest).getRegion(),
-                     dtor.getTriggerStmt(), pred, dstSet);
+                     Dtor.getTriggerStmt(), Pred, Dst);
 }
 
 void ExprEngine::ProcessBaseDtor(const CFGBaseDtor D,
-                                   StmtNodeBuilder &builder) {
-}
+                                 ExplodedNode *Pred, ExplodedNodeSet &Dst) {}
 
 void ExprEngine::ProcessMemberDtor(const CFGMemberDtor D,
-                                     StmtNodeBuilder &builder) {
-}
+                                   ExplodedNode *Pred, ExplodedNodeSet &Dst) {}
 
 void ExprEngine::ProcessTemporaryDtor(const CFGTemporaryDtor D,
-                                        StmtNodeBuilder &builder) {
-}
+                                      ExplodedNode *Pred,
+                                      ExplodedNodeSet &Dst) {}
 
 void ExprEngine::Visit(const Stmt *S, ExplodedNode *Pred, 
                        ExplodedNodeSet &Dst) {
@@ -937,20 +926,6 @@
 }
 
 //===----------------------------------------------------------------------===//
-// Generic node creation.
-//===----------------------------------------------------------------------===//
-
-ExplodedNode *ExprEngine::MakeNode(ExplodedNodeSet &Dst, const Stmt *S,
-                                   ExplodedNode *Pred, const ProgramState *St,
-                                   ProgramPoint::Kind K,
-                                   const ProgramPointTag *tag) {
-  assert (Builder && "StmtNodeBuilder not present.");
-  SaveAndRestore<const ProgramPointTag*> OldTag(Builder->Tag);
-  Builder->Tag = tag;
-  return Builder->MakeNode(Dst, S, Pred, St, K);
-}
-
-//===----------------------------------------------------------------------===//
 // Branch processing.
 //===----------------------------------------------------------------------===//
 
@@ -1294,7 +1269,7 @@
 void ExprEngine::VisitCommonDeclRefExpr(const Expr *Ex, const NamedDecl *D,
                                         ExplodedNode *Pred,
                                         ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
 
   const ProgramState *state = Pred->getState();
 
@@ -1343,7 +1318,7 @@
   ExplodedNodeSet checkerPreStmt;
   getCheckerManager().runCheckersForPreStmt(checkerPreStmt, Pred, A, *this);
 
-  PureStmtNodeBuilder Bldr(checkerPreStmt, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(checkerPreStmt, Dst, *currentBuilderContext);
 
   for (ExplodedNodeSet::iterator it = checkerPreStmt.begin(),
                                  ei = checkerPreStmt.end(); it != ei; ++it) {
@@ -1360,7 +1335,7 @@
 void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
                                  ExplodedNodeSet &Dst) {
 
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   Decl *member = M->getMemberDecl();
   if (VarDecl *VD = dyn_cast<VarDecl>(member)) {
     assert(M->isLValue());
@@ -1451,9 +1426,6 @@
                              ExplodedNode *Pred,
                              const ProgramState *state, SVal location, SVal Val,
                              const ProgramPointTag *tag) {
-
-  assert(Builder && "StmtNodeBuilder must be defined.");
-
   // Proceed with the store.  We use AssignE as the anchor for the PostStore
   // ProgramPoint if it is non-NULL, and LocationE otherwise.
   const Expr *StoreE = AssignE ? AssignE : LocationE;
@@ -1529,7 +1501,7 @@
   if (Tmp.empty())
     return;
 
-  PureStmtNodeBuilder Bldr(Tmp, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Tmp, Dst, *currentBuilderContext);
   if (location.isUndef())
     return;
 
@@ -1556,7 +1528,7 @@
                                 ExplodedNode *Pred,
                                 const ProgramState *state, SVal location,
                                 const ProgramPointTag *tag, bool isLoad) {
-  PureStmtNodeBuilder BldrTop(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder BldrTop(Pred, Dst, *currentBuilderContext);
   // Early checks for performance reason.
   if (location.isUnknown()) {
     return;
@@ -1633,7 +1605,7 @@
     const StackFrameContext *stackFrame = 
       AMgr.getStackFrame(AMgr.getAnalysisDeclContext(FD), 
                          Pred->getLocationContext(),
-                         CE, Builder->getBlock(), Builder->getIndex());
+                         CE, currentBuilderContext->getBlock(), currentStmtIdx);
     // Now we have the definition of the callee, create a CallEnter node.
     CallEnter Loc(CE, stackFrame, Pred->getLocationContext());
 
@@ -1649,7 +1621,7 @@
       return false;
     const StackFrameContext *stackFrame = 
       AMgr.getStackFrame(C, Pred->getLocationContext(),
-                         CE, Builder->getBlock(), Builder->getIndex());
+                         CE, currentBuilderContext->getBlock(), currentStmtIdx);
     CallEnter Loc(CE, stackFrame, Pred->getLocationContext());
     ExplodedNode *N = Builder->generateNode(Loc, state, Pred);
     Dst.Add(N);
@@ -1672,7 +1644,7 @@
 
 void ExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
                                      const Expr *Ex) {
-  PureStmtNodeBuilder Bldr(Src, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Src, Dst, *currentBuilderContext);
   
   for (ExplodedNodeSet::iterator I=Src.begin(), E=Src.end(); I!=E; ++I) {
     ExplodedNode *Pred = *I;
@@ -1735,7 +1707,7 @@
                                             ExplodedNode *Pred,
                                             ExplodedNodeSet &Dst) {
   if (I == E) {
-    PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+    PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
     // We have processed both the inputs and the outputs.  All of the outputs
     // should evaluate to Locs.  Nuke all of their values.
 

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp?rev=142847&r1=142846&r2=142847&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp Mon Oct 24 16:19:48 2011
@@ -57,7 +57,7 @@
     }
       
     if (!B->isAssignmentOp()) {
-      PureStmtNodeBuilder Bldr(*it, Tmp2, *currentBuilderContext, Builder);
+      PureStmtNodeBuilder Bldr(*it, Tmp2, *currentBuilderContext);
       // Process non-assignments except commas or short-circuited
       // logical expressions (LAnd and LOr).
       SVal Result = evalBinOp(state, Op, LeftV, RightV, B->getType());      
@@ -198,7 +198,7 @@
   if (const ExplicitCastExpr *ExCast=dyn_cast_or_null<ExplicitCastExpr>(CastE))
     T = ExCast->getTypeAsWritten();
   
-  PureStmtNodeBuilder Bldr(dstPreStmt, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(dstPreStmt, Dst, *currentBuilderContext);
   for (ExplodedNodeSet::iterator I = dstPreStmt.begin(), E = dstPreStmt.end();
        I != E; ++I) {
     
@@ -304,7 +304,7 @@
 void ExprEngine::VisitCompoundLiteralExpr(const CompoundLiteralExpr *CL,
                                           ExplodedNode *Pred,
                                           ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext);
 
   const InitListExpr *ILE 
     = cast<InitListExpr>(CL->getInitializer()->IgnoreParens());
@@ -340,7 +340,7 @@
   ExplodedNodeSet dstPreVisit;
   getCheckerManager().runCheckersForPreStmt(dstPreVisit, Pred, DS, *this);
   
-  PureStmtNodeBuilder B(dstPreVisit, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder B(dstPreVisit, Dst, *currentBuilderContext);
   const VarDecl *VD = dyn_cast<VarDecl>(D);
   for (ExplodedNodeSet::iterator I = dstPreVisit.begin(), E = dstPreVisit.end();
        I!=E; ++I) {
@@ -384,7 +384,7 @@
   assert(B->getOpcode() == BO_LAnd ||
          B->getOpcode() == BO_LOr);
 
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   const ProgramState *state = Pred->getState();
   SVal X = state->getSVal(B);
   assert(X.isUndef());
@@ -430,7 +430,7 @@
 void ExprEngine::VisitInitListExpr(const InitListExpr *IE,
                                    ExplodedNode *Pred,
                                    ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext);
 
   const ProgramState *state = Pred->getState();
   QualType T = getContext().getCanonicalType(IE->getType());
@@ -472,7 +472,7 @@
                                   const Expr *R,
                                   ExplodedNode *Pred,
                                   ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext);
   
   const ProgramState *state = Pred->getState();
   SVal X = state->getSVal(Ex);  
@@ -488,7 +488,7 @@
 void ExprEngine::
 VisitOffsetOfExpr(const OffsetOfExpr *OOE, 
                   ExplodedNode *Pred, ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder B(Pred, Dst, *currentBuilderContext);
   Expr::EvalResult Res;
   if (OOE->Evaluate(Res, getContext()) && Res.Val.isInt()) {
     const APSInt &IV = Res.Val.getInt();
@@ -506,7 +506,7 @@
 VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *Ex,
                               ExplodedNode *Pred,
                               ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
 
   QualType T = Ex->getTypeOfArgument();
   
@@ -701,7 +701,7 @@
     evalLoad(Tmp2, Ex, *I, state, loc);
     
     ExplodedNodeSet Dst2;
-    PureStmtNodeBuilder Bldr(Tmp2, Dst2, *currentBuilderContext, Builder);
+    PureStmtNodeBuilder Bldr(Tmp2, Dst2, *currentBuilderContext);
     for (ExplodedNodeSet::iterator I2=Tmp2.begin(), E2=Tmp2.end();I2!=E2;++I2) {
       
       state = (*I2)->getState();

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp?rev=142847&r1=142846&r2=142847&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp Mon Oct 24 16:19:48 2011
@@ -107,7 +107,7 @@
 void ExprEngine::CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME,
                                           ExplodedNode *Pred,
                                           ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   const Expr *tempExpr = ME->GetTemporaryExpr()->IgnoreParens();
   const ProgramState *state = Pred->getState();
 
@@ -199,8 +199,7 @@
   // Default semantics: invalidate all regions passed as arguments.
   ExplodedNodeSet destCall;
   {
-    PureStmtNodeBuilder Bldr(destPreVisit, destCall,
-                             *currentBuilderContext, Builder);
+    PureStmtNodeBuilder Bldr(destPreVisit, destCall, *currentBuilderContext);
     for (ExplodedNodeSet::iterator
         i = destPreVisit.begin(), e = destPreVisit.end();
         i != e; ++i)
@@ -222,7 +221,7 @@
                                       const Stmt *S,
                                       ExplodedNode *Pred, 
                                       ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   if (!(DD->doesThisDeclarationHaveABody() && AMgr.shouldInlineCall()))
     return;
 
@@ -243,7 +242,7 @@
 
 void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
                                    ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   
   unsigned blockCount = currentBuilderContext->getCurrentBlockCount();
   DefinedOrUnknownSVal symVal =
@@ -324,7 +323,7 @@
   // Should do more checking.
   ExplodedNodeSet Argevaluated;
   Visit(CDE->getArgument(), Pred, Argevaluated);
-  PureStmtNodeBuilder Bldr(Argevaluated, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Argevaluated, Dst, *currentBuilderContext);
   for (ExplodedNodeSet::iterator I = Argevaluated.begin(), 
                                  E = Argevaluated.end(); I != E; ++I) {
     const ProgramState *state = (*I)->getState();
@@ -334,7 +333,7 @@
 
 void ExprEngine::VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred,
                                     ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext, Builder);
+  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
 
   // Get the this object region from StoreManager.
   const MemRegion *R =

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp?rev=142847&r1=142846&r2=142847&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp Mon Oct 24 16:19:48 2011
@@ -146,7 +146,6 @@
   //  to identify conjured symbols by an expression pair: the enclosing
   //  expression (the context) and the expression itself.  This should
   //  disambiguate conjured symbols.
-  assert(Builder && "Invalidating arguments outside of a statement context");
   unsigned Count = currentBuilderContext->getCurrentBlockCount();
   StoreManager::InvalidatedSymbols IS;
 
@@ -180,7 +179,7 @@
       }
 
       // First handle the return value.
-      PureStmtNodeBuilder Bldr(Pred, Dst, *Eng.currentBuilderContext, Eng.Builder);
+      PureStmtNodeBuilder Bldr(Pred, Dst, *Eng.currentBuilderContext);
 
       // Get the callee.
       const Expr *Callee = CE->getCallee()->IgnoreParens();
@@ -232,7 +231,7 @@
                                  ExplodedNodeSet &Dst) {
   ExplodedNodeSet Src;
   {
-    PureStmtNodeBuilder Bldr(Pred, Src, *currentBuilderContext, Builder);
+    PureStmtNodeBuilder Bldr(Pred, Src, *currentBuilderContext);
     if (const Expr *RetE = RS->getRetValue()) {
       // Record the returned expression in the state. It will be used in
       // processCallExit to bind the return value to the call expr.





More information about the cfe-commits mailing list