[cfe-commits] r142849 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp lib/StaticAnalyzer/Core/CoreEngine.cpp lib/StaticAnalyzer/Core/ExprEngine.cpp lib/StaticAnalyzer/Core/ExprEngineC.cpp lib/StaticAnalyzer/Core/ExprEngineCXX.cpp lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp lib/StaticAnalyzer/Core/ExprEngineObjC.cpp

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


Author: zaks
Date: Mon Oct 24 16:19:59 2011
New Revision: 142849

URL: http://llvm.org/viewvc/llvm-project?rev=142849&view=rev
Log:
[analyzer] Node builders cleanup + comments
Renamed PureNodeBuilder->StmtNodeBuilder.

Modified:
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
    cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h
    cfe/trunk/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
    cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.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
    cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp

Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h?rev=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h Mon Oct 24 16:19:59 2011
@@ -188,7 +188,15 @@
 
 };
 
-/// This is the simplest builder which generates nodes in the ExplodedGraph.
+/// \class NodeBuilder
+/// \brief This is the simplest builder which generates nodes in the
+/// ExplodedGraph.
+///
+/// The main benefit of the builder is that it automatically tracks the
+/// frontier nodes (or destination set). This is the set of nodes which should
+/// be propagated to the next step / builder. They are the nodes which have been
+/// added to the builder (either as the input node set or as the newly
+/// constructed nodes) but did not have any outgoing transitions added.
 class NodeBuilder {
 protected:
   const NodeBuilderContext &C;
@@ -196,9 +204,7 @@
   /// Specifies if the builder results have been finalized. For example, if it
   /// is set to false, autotransitions are yet to be generated.
   bool Finalized;
-
   bool HasGeneratedNodes;
-
   /// \brief The frontier set - a set of nodes which need to be propagated after
   /// the builder dies.
   ExplodedNodeSet &Frontier;
@@ -210,7 +216,7 @@
     return true;
   }
 
-  bool haveNoSinksInFrontier() {
+  bool hasNoSinksInFrontier() {
     for (iterator I = Frontier.begin(), E = Frontier.end(); I != E; ++I) {
       if ((*I)->isSink())
         return false;
@@ -230,17 +236,14 @@
   NodeBuilder(ExplodedNode *SrcNode, ExplodedNodeSet &DstSet,
               const NodeBuilderContext &Ctx, bool F = true)
     : C(Ctx), Finalized(F), HasGeneratedNodes(false), Frontier(DstSet) {
-  //  assert(DstSet.empty());
     Frontier.Add(SrcNode);
   }
 
   NodeBuilder(const ExplodedNodeSet &SrcSet, ExplodedNodeSet &DstSet,
               const NodeBuilderContext &Ctx, bool F = true)
     : C(Ctx), Finalized(F), HasGeneratedNodes(false), Frontier(DstSet) {
-    //assert(DstSet.empty());
-    //assert(!SrcSet.empty());
     Frontier.insert(SrcSet);
-    assert(haveNoSinksInFrontier());
+    assert(hasNoSinksInFrontier());
   }
 
   virtual ~NodeBuilder() {}
@@ -256,11 +259,6 @@
     return generateNodeImpl(PP, State, Pred, MarkAsSink);
   }
 
-  // TODO: will get removed.
-  bool hasGeneratedNodes() const {
-    return HasGeneratedNodes;
-  }
-
   const ExplodedNodeSet &getResults() {
     finalizeResults();
     assert(checkResults());
@@ -280,24 +278,15 @@
   }
 
   const NodeBuilderContext &getContext() { return C; }
+  bool hasGeneratedNodes() { return HasGeneratedNodes; }
 
   void takeNodes(const ExplodedNodeSet &S) {
     for (ExplodedNodeSet::iterator I = S.begin(), E = S.end(); I != E; ++I )
       Frontier.erase(*I);
   }
-
-  void takeNodes(ExplodedNode *N) {
-    Frontier.erase(N);
-  }
-
-  void addNodes(const ExplodedNodeSet &S) {
-    Frontier.insert(S);
-  }
-
-  void addNodes(ExplodedNode *N) {
-    Frontier.Add(N);
-  }
-
+  void takeNodes(ExplodedNode *N) { Frontier.erase(N); }
+  void addNodes(const ExplodedNodeSet &S) { Frontier.insert(S); }
+  void addNodes(ExplodedNode *N) { Frontier.Add(N); }
 };
 
 class CommonNodeBuilder {
@@ -309,41 +298,41 @@
   BlockCounter getBlockCounter() const { return Eng.WList->getBlockCounter(); }
 };
 
-
-class PureStmtNodeBuilder: public NodeBuilder {
+/// \class StmtNodeBuilder
+/// \brief This builder class is useful for generating nodes that resulted from
+/// visiting a statement. The main difference from it's parent NodeBuilder is
+/// that it creates a statement specific ProgramPoint.
+class StmtNodeBuilder: public NodeBuilder {
   NodeBuilder *EnclosingBldr;
 public:
-  PureStmtNodeBuilder(ExplodedNode *SrcNode, ExplodedNodeSet &DstSet,
+
+  /// \brief Constructs a StmtNodeBuilder. If the builder is going to process
+  /// nodes currently owned by another builder(with larger scope), use
+  /// Enclosing builder to transfer ownership.
+  StmtNodeBuilder(ExplodedNode *SrcNode, ExplodedNodeSet &DstSet,
                       const NodeBuilderContext &Ctx, NodeBuilder *Enclosing = 0)
     : NodeBuilder(SrcNode, DstSet, Ctx), EnclosingBldr(Enclosing) {
     if (EnclosingBldr)
       EnclosingBldr->takeNodes(SrcNode);
   }
 
-  PureStmtNodeBuilder(ExplodedNodeSet &SrcSet, ExplodedNodeSet &DstSet,
+  StmtNodeBuilder(ExplodedNodeSet &SrcSet, ExplodedNodeSet &DstSet,
                       const NodeBuilderContext &Ctx, NodeBuilder *Enclosing = 0)
     : NodeBuilder(SrcSet, DstSet, Ctx), EnclosingBldr(Enclosing) {
     if (EnclosingBldr)
       for (ExplodedNodeSet::iterator I = SrcSet.begin(),
                                      E = SrcSet.end(); I != E; ++I )
         EnclosingBldr->takeNodes(*I);
-
   }
 
-  virtual ~PureStmtNodeBuilder();
+  virtual ~StmtNodeBuilder();
 
   ExplodedNode *generateNode(const Stmt *S,
                              ExplodedNode *Pred,
                              const ProgramState *St,
                              bool MarkAsSink = false,
                              const ProgramPointTag *tag = 0,
-                             ProgramPoint::Kind K = ProgramPoint::PostStmtKind,
-                             bool Purging = false) {
-    if (Purging) {
-      assert(K == ProgramPoint::PostStmtKind);
-      K = ProgramPoint::PostPurgeDeadSymbolsKind;
-    }
-
+                             ProgramPoint::Kind K = ProgramPoint::PostStmtKind){
     const ProgramPoint &L = ProgramPoint::getProgramPoint(S, K,
                                   Pred->getLocationContext(), tag);
     return generateNodeImpl(L, St, Pred, MarkAsSink);
@@ -355,7 +344,6 @@
                              bool MarkAsSink = false) {
     return generateNodeImpl(PP, State, Pred, MarkAsSink);
   }
-
 };
 
 class BranchNodeBuilder: public NodeBuilder {

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=142849&r1=142848&r2=142849&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:59 2011
@@ -424,7 +424,7 @@
   }
   
 protected:
-  void evalObjCMessage(PureStmtNodeBuilder &Bldr, const ObjCMessage &msg,
+  void evalObjCMessage(StmtNodeBuilder &Bldr, const ObjCMessage &msg,
                        ExplodedNode *Pred, const ProgramState *state,
                        bool GenSink);
 

Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp?rev=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/OSAtomicChecker.cpp Mon Oct 24 16:19:59 2011
@@ -175,7 +175,7 @@
         return true;
       }
       
-      PureStmtNodeBuilder B(TmpStore, Dst, Eng.getBuilderContext());
+      StmtNodeBuilder B(TmpStore, Dst, Eng.getBuilderContext());
       // Now bind the result of the comparison.
       for (ExplodedNodeSet::iterator I2 = TmpStore.begin(),
            E2 = TmpStore.end(); I2 != E2; ++I2) {
@@ -197,7 +197,7 @@
       QualType T = CE->getType();
       if (!T->isVoidType())
         Res = Eng.getSValBuilder().makeTruthVal(false, CE->getType());
-      PureStmtNodeBuilder B(N, Dst, Eng.getBuilderContext());    
+      StmtNodeBuilder B(N, Dst, Eng.getBuilderContext());    
       B.generateNode(CE, N, stateNotEqual->BindExpr(CE, Res), false, this);
     }
   }

Modified: cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp?rev=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CoreEngine.cpp Mon Oct 24 16:19:59 2011
@@ -491,7 +491,6 @@
                                             ExplodedNode *FromN,
                                             bool MarkAsSink) {
   HasGeneratedNodes = true;
-
   bool IsNew;
   ExplodedNode *N = C.Eng.G->getNode(Loc, State, &IsNew);
   N->addPredecessor(FromN, *C.Eng.G);
@@ -506,7 +505,7 @@
   return (IsNew ? N : 0);
 }
 
-PureStmtNodeBuilder::~PureStmtNodeBuilder() {
+StmtNodeBuilder::~StmtNodeBuilder() {
   if (EnclosingBldr)
     for (ExplodedNodeSet::iterator I = Frontier.begin(),
                                    E = Frontier.end(); I != E; ++I )

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Mon Oct 24 16:19:59 2011
@@ -306,7 +306,7 @@
     // Generate a CleanedNode that has the environment and store cleaned
     // up. Since no symbols are dead, we can optimize and not clean out
     // the constraint manager.
-    PureStmtNodeBuilder Bldr(Pred, Tmp, *currentBuilderContext);
+    StmtNodeBuilder Bldr(Pred, Tmp, *currentBuilderContext);
     Bldr.generateNode(currentStmt, EntryNode, CleanedState, false, &cleanupTag);
 
   } else {
@@ -319,7 +319,7 @@
     // For each node in CheckedSet, generate CleanedNodes that have the
     // environment, the store, and the constraints cleaned up but have the
     // user-supplied states as the predecessors.
-    PureStmtNodeBuilder Bldr(CheckedSet, Tmp, *currentBuilderContext);
+    StmtNodeBuilder Bldr(CheckedSet, Tmp, *currentBuilderContext);
     for (ExplodedNodeSet::const_iterator
           I = CheckedSet.begin(), E = CheckedSet.end(); I != E; ++I) {
       const ProgramState *CheckerState = (*I)->getState();
@@ -384,7 +384,7 @@
     // Evaluate the initializer.
     Visit(BMI->getInit(), Pred, AfterEval);
 
-    PureStmtNodeBuilder Bldr(AfterEval, Dst, *currentBuilderContext);
+    StmtNodeBuilder Bldr(AfterEval, Dst, *currentBuilderContext);
     for (ExplodedNodeSet::iterator I = AfterEval.begin(),
                                    E = AfterEval.end(); I != E; ++I){
       ExplodedNode *P = *I;
@@ -484,7 +484,7 @@
   PrettyStackTraceLoc CrashInfo(getContext().getSourceManager(),
                                 S->getLocStart(),
                                 "Error evaluating statement");
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
 
   // Expressions to ignore.
   if (const Expr *Ex = dyn_cast<Expr>(S))
@@ -1269,7 +1269,7 @@
 void ExprEngine::VisitCommonDeclRefExpr(const Expr *Ex, const NamedDecl *D,
                                         ExplodedNode *Pred,
                                         ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
 
   const ProgramState *state = Pred->getState();
 
@@ -1318,7 +1318,7 @@
   ExplodedNodeSet checkerPreStmt;
   getCheckerManager().runCheckersForPreStmt(checkerPreStmt, Pred, A, *this);
 
-  PureStmtNodeBuilder Bldr(checkerPreStmt, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(checkerPreStmt, Dst, *currentBuilderContext);
 
   for (ExplodedNodeSet::iterator it = checkerPreStmt.begin(),
                                  ei = checkerPreStmt.end(); it != ei; ++it) {
@@ -1335,7 +1335,7 @@
 void ExprEngine::VisitMemberExpr(const MemberExpr *M, ExplodedNode *Pred,
                                  ExplodedNodeSet &Dst) {
 
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   Decl *member = M->getMemberDecl();
   if (VarDecl *VD = dyn_cast<VarDecl>(member)) {
     assert(M->isLValue());
@@ -1392,7 +1392,7 @@
 
   // TODO:AZ Remove TmpDst after NB refactoring is done.
   ExplodedNodeSet TmpDst;
-  PureStmtNodeBuilder Bldr(CheckedSet, TmpDst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(CheckedSet, TmpDst, *currentBuilderContext);
 
   for (ExplodedNodeSet::iterator I = CheckedSet.begin(), E = CheckedSet.end();
        I!=E; ++I) {
@@ -1501,7 +1501,7 @@
   if (Tmp.empty())
     return;
 
-  PureStmtNodeBuilder Bldr(Tmp, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Tmp, Dst, *currentBuilderContext);
   if (location.isUndef())
     return;
 
@@ -1528,7 +1528,7 @@
                                 ExplodedNode *Pred,
                                 const ProgramState *state, SVal location,
                                 const ProgramPointTag *tag, bool isLoad) {
-  PureStmtNodeBuilder BldrTop(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder BldrTop(Pred, Dst, *currentBuilderContext);
   // Early checks for performance reason.
   if (location.isUnknown()) {
     return;
@@ -1536,7 +1536,7 @@
 
   ExplodedNodeSet Src;
   BldrTop.takeNodes(Pred);
-  PureStmtNodeBuilder Bldr(Pred, Src, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Src, *currentBuilderContext);
   if (Pred->getState() != state) {
     // Associate this new state with an ExplodedNode.
     // FIXME: If I pass null tag, the graph is incorrect, e.g for
@@ -1644,7 +1644,7 @@
 
 void ExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
                                      const Expr *Ex) {
-  PureStmtNodeBuilder Bldr(Src, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Src, Dst, *currentBuilderContext);
   
   for (ExplodedNodeSet::iterator I=Src.begin(), E=Src.end(); I!=E; ++I) {
     ExplodedNode *Pred = *I;
@@ -1707,7 +1707,7 @@
                                             ExplodedNode *Pred,
                                             ExplodedNodeSet &Dst) {
   if (I == E) {
-    PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+    StmtNodeBuilder 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=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineC.cpp Mon Oct 24 16:19:59 2011
@@ -57,7 +57,7 @@
     }
       
     if (!B->isAssignmentOp()) {
-      PureStmtNodeBuilder Bldr(*it, Tmp2, *currentBuilderContext);
+      StmtNodeBuilder 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());      
@@ -166,7 +166,7 @@
                                        Pred->getLocationContext());
   
   ExplodedNodeSet Tmp;
-  PureStmtNodeBuilder Bldr(Pred, Tmp, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Tmp, *currentBuilderContext);
   Bldr.generateNode(BE, Pred, Pred->getState()->BindExpr(BE, V), false, 0,
                     ProgramPoint::PostLValueKind);
   
@@ -198,7 +198,7 @@
   if (const ExplicitCastExpr *ExCast=dyn_cast_or_null<ExplicitCastExpr>(CastE))
     T = ExCast->getTypeAsWritten();
   
-  PureStmtNodeBuilder Bldr(dstPreStmt, Dst, *currentBuilderContext);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder 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);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
 
   QualType T = Ex->getTypeOfArgument();
   
@@ -539,7 +539,7 @@
 void ExprEngine::VisitUnaryOperator(const UnaryOperator* U, 
                                     ExplodedNode *Pred,
                                     ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   bool IncDec = false;
   switch (U->getOpcode()) {
     default: {
@@ -701,7 +701,7 @@
     evalLoad(Tmp2, Ex, *I, state, loc);
     
     ExplodedNodeSet Dst2;
-    PureStmtNodeBuilder Bldr(Tmp2, Dst2, *currentBuilderContext);
+    StmtNodeBuilder 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=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp Mon Oct 24 16:19:59 2011
@@ -107,7 +107,7 @@
 void ExprEngine::CreateCXXTemporaryObject(const MaterializeTemporaryExpr *ME,
                                           ExplodedNode *Pred,
                                           ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   const Expr *tempExpr = ME->GetTemporaryExpr()->IgnoreParens();
   const ProgramState *state = Pred->getState();
 
@@ -184,7 +184,7 @@
 
     CallEnter Loc(E, SFC, Pred->getLocationContext());
 
-    PureStmtNodeBuilder Bldr(argsEvaluated, destNodes, *currentBuilderContext);
+    StmtNodeBuilder Bldr(argsEvaluated, destNodes, *currentBuilderContext);
     for (ExplodedNodeSet::iterator NI = argsEvaluated.begin(),
                                   NE = argsEvaluated.end(); NI != NE; ++NI) {
       const ProgramState *state = (*NI)->getState();
@@ -199,7 +199,7 @@
   // Default semantics: invalidate all regions passed as arguments.
   ExplodedNodeSet destCall;
   {
-    PureStmtNodeBuilder Bldr(destPreVisit, destCall, *currentBuilderContext);
+    StmtNodeBuilder Bldr(destPreVisit, destCall, *currentBuilderContext);
     for (ExplodedNodeSet::iterator
         i = destPreVisit.begin(), e = destPreVisit.end();
         i != e; ++i)
@@ -221,7 +221,7 @@
                                       const Stmt *S,
                                       ExplodedNode *Pred, 
                                       ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   if (!(DD->doesThisDeclarationHaveABody() && AMgr.shouldInlineCall()))
     return;
 
@@ -242,7 +242,7 @@
 
 void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred,
                                    ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   
   unsigned blockCount = currentBuilderContext->getCurrentBlockCount();
   DefinedOrUnknownSVal symVal =
@@ -323,7 +323,7 @@
   // Should do more checking.
   ExplodedNodeSet Argevaluated;
   Visit(CDE->getArgument(), Pred, Argevaluated);
-  PureStmtNodeBuilder Bldr(Argevaluated, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Argevaluated, Dst, *currentBuilderContext);
   for (ExplodedNodeSet::iterator I = Argevaluated.begin(), 
                                  E = Argevaluated.end(); I != E; ++I) {
     const ProgramState *state = (*I)->getState();
@@ -333,7 +333,7 @@
 
 void ExprEngine::VisitCXXThisExpr(const CXXThisExpr *TE, ExplodedNode *Pred,
                                     ExplodedNodeSet &Dst) {
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder 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=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp Mon Oct 24 16:19:59 2011
@@ -179,7 +179,7 @@
       }
 
       // First handle the return value.
-      PureStmtNodeBuilder Bldr(Pred, Dst, *Eng.currentBuilderContext);
+      StmtNodeBuilder Bldr(Pred, Dst, *Eng.currentBuilderContext);
 
       // Get the callee.
       const Expr *Callee = CE->getCallee()->IgnoreParens();
@@ -231,7 +231,7 @@
                                  ExplodedNodeSet &Dst) {
   ExplodedNodeSet Src;
   {
-    PureStmtNodeBuilder Bldr(Pred, Src, *currentBuilderContext);
+    StmtNodeBuilder 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.

Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp?rev=142849&r1=142848&r2=142849&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp Mon Oct 24 16:19:59 2011
@@ -26,7 +26,7 @@
   SVal location = state->getLValue(Ex->getDecl(), baseVal);
   
   ExplodedNodeSet dstIvar;
-  PureStmtNodeBuilder Bldr(Pred, dstIvar, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, dstIvar, *currentBuilderContext);
   Bldr.generateNode(Ex, Pred, state->BindExpr(Ex, location));
   
   // Perform the post-condition check of the ObjCIvarRefExpr and store
@@ -72,7 +72,7 @@
   const Stmt *elem = S->getElement();
   const ProgramState *state = Pred->getState();
   SVal elementV;
-  PureStmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
+  StmtNodeBuilder Bldr(Pred, Dst, *currentBuilderContext);
   
   if (const DeclStmt *DS = dyn_cast<DeclStmt>(elem)) {
     const VarDecl *elemD = cast<VarDecl>(DS->getSingleDecl());
@@ -136,7 +136,7 @@
   
   // Proceed with evaluate the message expression.
   ExplodedNodeSet dstEval;
-  PureStmtNodeBuilder Bldr(dstPrevisit, dstEval, *currentBuilderContext);
+  StmtNodeBuilder Bldr(dstPrevisit, dstEval, *currentBuilderContext);
 
   for (ExplodedNodeSet::iterator DI = dstPrevisit.begin(),
        DE = dstPrevisit.end(); DI != DE; ++DI) {
@@ -223,7 +223,7 @@
   getCheckerManager().runCheckersForPostObjCMessage(Dst, dstEval, msg, *this);
 }
 
-void ExprEngine::evalObjCMessage(PureStmtNodeBuilder &Bldr,
+void ExprEngine::evalObjCMessage(StmtNodeBuilder &Bldr,
                                  const ObjCMessage &msg,
                                  ExplodedNode *Pred,
                                  const ProgramState *state,





More information about the cfe-commits mailing list