]> granicus.if.org Git - clang/commitdiff
[analyzer] Simplify CheckerContext
authorAnna Zaks <ganna@apple.com>
Tue, 25 Oct 2011 19:57:06 +0000 (19:57 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 25 Oct 2011 19:57:06 +0000 (19:57 +0000)
Remove dead members/parameters: ProgramState, respondsToCallback, autoTransition.
Remove addTransition method since it's the same as generateNode. Maybe we should
rename generateNode to genTransition (since a transition is always automatically
generated)?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142946 91177308-0d34-0410-b5e6-96231b3b80d8

21 files changed:
include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp
lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
lib/StaticAnalyzer/Checkers/CStringChecker.cpp
lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp
lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
lib/StaticAnalyzer/Checkers/MallocChecker.cpp
lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
lib/StaticAnalyzer/Checkers/StreamChecker.cpp
lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
lib/StaticAnalyzer/Core/CheckerManager.cpp

index f2e1e2fb23be86d8b5f1810180e99125011f6ba2..3edb0d868b3d920991c2d49e19f3910efa98371d 100644 (file)
@@ -24,25 +24,17 @@ class CheckerContext {
   ExprEngine &Eng;
   ExplodedNode *Pred;
   const ProgramPoint Location;
-  const ProgramState *ST;
   NodeBuilder &NB;
-public:
-  bool *respondsToCallback;
+
 public:
   CheckerContext(NodeBuilder &builder,
                  ExprEngine &eng,
                  ExplodedNode *pred,
-                 const ProgramPoint &loc,
-                 bool *respondsToCB = 0,
-                 const ProgramState *st = 0)
+                 const ProgramPoint &loc)
     : Eng(eng),
       Pred(pred),
       Location(loc),
-      ST(st),
-      NB(builder),
-      respondsToCallback(respondsToCB) {
-    assert(!(ST && ST != Pred->getState()));
-  }
+      NB(builder) {}
 
   ~CheckerContext();
 
@@ -63,7 +55,7 @@ public:
   }
 
   ExplodedNode *&getPredecessor() { return Pred; }
-  const ProgramState *getState() { return ST ? ST : Pred->getState(); }
+  const ProgramState *getState() { return Pred->getState(); }
 
   /// \brief Returns the number of times the current block has been visited
   /// along the analyzed path.
@@ -95,29 +87,29 @@ public:
     return Eng.isObjCGCEnabled();
   }
 
+  AnalysisDeclContext *getCurrentAnalysisDeclContext() const {
+    return Pred->getLocationContext()->getAnalysisDeclContext();
+  }
+
   /// \brief Generate a default checker node (containing checker tag but no
   /// checker state changes).
-  ExplodedNode *generateNode(bool autoTransition = true) {
-    return generateNode(getState(), autoTransition);
+  ExplodedNode *generateNode() {
+    return generateNode(getState());
   }
   
+  /// \brief Generate a new checker node.
+  ExplodedNode *generateNode(const ProgramState *state,
+                             const ProgramPointTag *tag = 0) {
+    return generateNodeImpl(state, false, 0, tag);
+  }
+
   /// \brief Generate a new checker node with the given predecessor.
   /// Allows checkers to generate a chain of nodes.
   ExplodedNode *generateNode(const ProgramState *state,
                              ExplodedNode *pred,
                              const ProgramPointTag *tag = 0,
-                             bool autoTransition = true,
                              bool isSink = false) {
-    ExplodedNode *N = generateNodeImpl(state, isSink, pred, tag);
-    return N;
-  }
-
-  /// \brief Generate a new checker node.
-  ExplodedNode *generateNode(const ProgramState *state,
-                             bool autoTransition = true,
-                             const ProgramPointTag *tag = 0) {
-    ExplodedNode *N = generateNodeImpl(state, false, 0, tag);
-    return N;
+    return generateNodeImpl(state, isSink, pred, tag);
   }
 
   /// \brief Generate a sink node. Generating sink stops exploration of the
@@ -126,28 +118,17 @@ public:
     return generateNodeImpl(state ? state : getState(), true);
   }
 
-  void addTransition(const ProgramState *state,
-                     const ProgramPointTag *tag = 0) {
-    assert(state);
-    // If the 'state' is not new, we need to check if the cached state 'ST'
-    // is new.
-    if (state != getState())
-      generateNode(state, true, tag);
-  }
-
+  /// \brief Emit the diagnostics report.
   void EmitReport(BugReport *R) {
     Eng.getBugReporter().EmitReport(R);
   }
 
-  AnalysisDeclContext *getCurrentAnalysisDeclContext() const {
-    return Pred->getLocationContext()->getAnalysisDeclContext();
-  }
-
 private:
   ExplodedNode *generateNodeImpl(const ProgramState *state,
                                  bool markAsSink,
                                  ExplodedNode *pred = 0,
                                  const ProgramPointTag *tag = 0) {
+    assert(state);
     ExplodedNode *node = NB.generateNode(tag ? Location.withTag(tag) : Location,
                                         state,
                                         pred ? pred : Pred, markAsSink);
index 6935c5f1c19239e85927c5f66cd2e60d02295936..f8cd335258b06dfc08848f47ed2f432d6e1e76f9 100644 (file)
@@ -84,8 +84,7 @@ void ArrayBoundChecker::checkLocation(SVal l, bool isLoad, const Stmt* LoadS,
   
   // Array bound check succeeded.  From this point forward the array bound
   // should always succeed.
-  assert(StInBound);
-  C.addTransition(StInBound);
+  C.generateNode(StInBound);
 }
 
 void ento::registerArrayBoundChecker(CheckerManager &mgr) {
index 8296eb93c5aed18837389eff3475c8e4b1c0e447..fa96d62ce3a48edb5cda70b1b968b24c4e961d8a 100644 (file)
@@ -125,7 +125,7 @@ void AttrNonNullChecker::checkPreStmt(const CallExpr *CE,
 
   // If we reach here all of the arguments passed the nonnull check.
   // If 'state' has been updated generated a new node.
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void ento::registerAttrNonNullChecker(CheckerManager &mgr) {
index 08cff0fd429262e3a3bd0a5d8d8e819581f011e8..0d68db3c8a2dea211388556dafcfdc392d47f5fb 100644 (file)
@@ -421,7 +421,7 @@ void CFRetainReleaseChecker::checkPreStmt(const CallExpr *CE,
   }
 
   // From here on, we know the argument is non-null.
-  C.addTransition(stateFalse);
+  C.generateNode(stateFalse);
 }
 
 //===----------------------------------------------------------------------===//
index 1625219fc877cad8889b10d4c7ea57ed8855b280..78c92ee8eae92008cece9f6395be072a26c5c573 100644 (file)
@@ -859,7 +859,7 @@ void CStringChecker::evalCopyCommon(CheckerContext &C,
   // just bind the return value to the destination buffer and return.
   if (stateZeroSize) {
     stateZeroSize = stateZeroSize->BindExpr(CE, destVal);
-    C.addTransition(stateZeroSize);
+    C.generateNode(stateZeroSize);
   }
 
   // If the size can be nonzero, we have to check the other arguments.
@@ -931,7 +931,7 @@ void CStringChecker::evalCopyCommon(CheckerContext &C,
     // This would probably remove any existing bindings past the end of the
     // copied region, but that's still an improvement over blank invalidation.
     state = InvalidateBuffer(C, state, Dest, state->getSVal(Dest));
-    C.addTransition(state);
+    C.generateNode(state);
   }
 }
 
@@ -993,7 +993,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) const {
   if (stateZeroSize) {
     state = stateZeroSize;
     state = state->BindExpr(CE, svalBuilder.makeZeroVal(CE->getType()));
-    C.addTransition(state);
+    C.generateNode(state);
   }
 
   // If the size can be nonzero, we have to check the other arguments.
@@ -1017,7 +1017,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) const {
       state = CheckBufferAccess(C, state, Size, Left);
       if (state) {
         state = StSameBuf->BindExpr(CE, svalBuilder.makeZeroVal(CE->getType()));
-        C.addTransition(state); 
+        C.generateNode(state);
       }
     }
 
@@ -1031,7 +1031,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) const {
         unsigned Count = C.getCurrentBlockCount();
         SVal CmpV = svalBuilder.getConjuredSymbolVal(NULL, CE, Count);
         state = state->BindExpr(CE, CmpV);
-        C.addTransition(state);
+        C.generateNode(state);
       }
     }
   }
@@ -1067,7 +1067,7 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C, const CallExpr *CE,
     if (stateZeroSize) {
       SVal zero = C.getSValBuilder().makeZeroVal(CE->getType());
       stateZeroSize = stateZeroSize->BindExpr(CE, zero);
-      C.addTransition(stateZeroSize);
+      C.generateNode(stateZeroSize);
     }
 
     // If the size is GUARANTEED to be zero, we're done!
@@ -1170,7 +1170,7 @@ void CStringChecker::evalstrLengthCommon(CheckerContext &C, const CallExpr *CE,
   // Bind the return value.
   assert(!result.isUnknown() && "Should have conjured a value by now");
   state = state->BindExpr(CE, result);
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void CStringChecker::evalStrcpy(CheckerContext &C, const CallExpr *CE) const {
@@ -1512,7 +1512,7 @@ void CStringChecker::evalStrcpyCommon(CheckerContext &C, const CallExpr *CE,
 
   // Set the return value.
   state = state->BindExpr(CE, Result);
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void CStringChecker::evalStrcmp(CheckerContext &C, const CallExpr *CE) const {
@@ -1582,7 +1582,7 @@ void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallExpr *CE,
   // and we only need to check one size.
   if (StSameBuf) {
     StSameBuf = StSameBuf->BindExpr(CE, svalBuilder.makeZeroVal(CE->getType()));
-    C.addTransition(StSameBuf);
+    C.generateNode(StSameBuf);
 
     // If the two arguments are GUARANTEED to be the same, we're done!
     if (!StNotSameBuf)
@@ -1656,7 +1656,7 @@ void CStringChecker::evalStrcmpCommon(CheckerContext &C, const CallExpr *CE,
   }
 
   // Record this as a possible path.
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 //===----------------------------------------------------------------------===//
@@ -1746,7 +1746,7 @@ void CStringChecker::checkPreStmt(const DeclStmt *DS, CheckerContext &C) const {
     state = state->set<CStringLength>(MR, strLength);
   }
 
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 bool CStringChecker::wantsRegionChangeUpdate(const ProgramState *state) const {
index 4db6ac0181a0b584ca8f079d2c0198a785e1d7b6..112424256a1cdbf73a14750cb53232067b3efa98 100644 (file)
@@ -312,7 +312,7 @@ void CallAndMessageChecker::HandleNilReceiver(CheckerContext &C,
 
     // The result is not consumed by a surrounding expression.  Just propagate
     // the current state.
-    C.addTransition(state);
+    C.generateNode(state);
     return;
   }
 
@@ -353,7 +353,7 @@ void CallAndMessageChecker::HandleNilReceiver(CheckerContext &C,
     return;
   }
 
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void ento::registerCallAndMessageChecker(CheckerManager &mgr) {
index 3c9238190da4741c68afa1fa1c547029ea68ef86..769a93e16193ce17380ccd6dd9e89e472cf5e1f3 100644 (file)
@@ -94,7 +94,7 @@ void ChrootChecker::Chroot(CheckerContext &C, const CallExpr *CE) const {
   // Once encouter a chroot(), set the enum value ROOT_CHANGED directly in 
   // the GDM.
   state = Mgr.addGDM(state, ChrootChecker::getTag(), (void*) ROOT_CHANGED);
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void ChrootChecker::Chdir(CheckerContext &C, const CallExpr *CE) const {
@@ -120,7 +120,7 @@ void ChrootChecker::Chdir(CheckerContext &C, const CallExpr *CE) const {
     }
   }
 
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 // Check the jail state before any function call except chroot and chdir().
index eeda734a07667089a00a38f20c3f883aeefddec4..ab9631dd3fe0047b48f974471b37ce4784ac08f5 100644 (file)
@@ -184,7 +184,7 @@ void DereferenceChecker::checkLocation(SVal l, bool isLoad, const Stmt* S,
   }
 
   // From this point forward, we know that the location is not null.
-  C.addTransition(notNullState);
+  C.generateNode(notNullState);
 }
 
 void ento::registerDereferenceChecker(CheckerManager &mgr) {
index 75b7cc47aa79104b1a49d43054e2d1608e1e448e..3bae92b2ec23a1f51805c5897e4dbf37facd3bf3 100644 (file)
@@ -73,7 +73,7 @@ void DivZeroChecker::checkPreStmt(const BinaryOperator *B,
 
   // If we get here, then the denom should not be zero. We abandon the implicit
   // zero denom case for now.
-  C.addTransition(stateNotZero);
+  C.generateNode(stateNotZero);
 }
 
 void ento::registerDivZeroChecker(CheckerManager &mgr) {
index fbc57d336f90c8da9838a36fd7fb493d84c8919a..d7496b1a6ea18f266c2f42551063bc63cf6f2670 100644 (file)
@@ -472,7 +472,7 @@ void IteratorsChecker::checkPreStmt(const CXXOperatorCallExpr *OCE,
   if (Kind == OO_Equal) {
     checkExpr(C, OCE->getArg(1));
     state = handleAssign(state, OCE->getArg(0), OCE->getArg(1), LC);
-    C.addTransition(state);
+    C.generateNode(state);
     return;
   }
   else {
@@ -550,7 +550,7 @@ void IteratorsChecker::checkPreStmt(const DeclStmt *DS,
       }
     }
   }
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 
@@ -600,6 +600,6 @@ void IteratorsChecker::checkPreStmt(const CXXMemberCallExpr *MCE,
     state = state->add<CalledReserved>(MR);
   
   if (state != C.getState())
-    C.addTransition(state);
+    C.generateNode(state);
 }
 
index e975dd55a89c07abb45debb83b712e344d377855..29e119da4d155386bbaf014004bb3cef4caabf4e 100644 (file)
@@ -400,7 +400,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
         // custom deallocator which does the right thing.
         if (DE->getFoundDecl()->getName() != "kCFAllocatorNull") {
           State = State->remove<AllocatedData>(ArgSM);
-          C.addTransition(State);
+          C.generateNode(State);
           return;
         }
       }
@@ -434,7 +434,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const CallExpr *CE,
     return;
   }
 
-  C.addTransition(State);
+  C.generateNode(State);
 }
 
 void MacOSKeychainAPIChecker::checkPostStmt(const CallExpr *CE,
@@ -482,7 +482,7 @@ void MacOSKeychainAPIChecker::checkPostStmt(const CallExpr *CE,
     State = State->set<AllocatedData>(V, AllocationState(ArgExpr, idx,
                                                          RetStatusSymbol));
     assert(State);
-    C.addTransition(State);
+    C.generateNode(State);
   }
 }
 
@@ -500,7 +500,7 @@ void MacOSKeychainAPIChecker::checkPreStmt(const ReturnStmt *S,
   state = state->remove<AllocatedData>(getSymbolForRegion(C, V));
 
   // Proceed from the new state.
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 BugReport *MacOSKeychainAPIChecker::
index a04f02493dfc563f9e8905db5545f1bc4c087038..edea33ea690dcc45230cccfb4dd4467ad8d8a864 100644 (file)
@@ -197,7 +197,7 @@ bool MallocChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
 void MallocChecker::MallocMem(CheckerContext &C, const CallExpr *CE) {
   const ProgramState *state = MallocMemAux(C, CE, CE->getArg(0), UndefinedVal(),
                                       C.getState());
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void MallocChecker::MallocMemReturnsAttr(CheckerContext &C, const CallExpr *CE,
@@ -209,12 +209,12 @@ void MallocChecker::MallocMemReturnsAttr(CheckerContext &C, const CallExpr *CE,
   if (I != E) {
     const ProgramState *state =
         MallocMemAux(C, CE, CE->getArg(*I), UndefinedVal(), C.getState());
-    C.addTransition(state);
+    C.generateNode(state);
     return;
   }
   const ProgramState *state = MallocMemAux(C, CE, UnknownVal(), UndefinedVal(),
                                         C.getState());
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 const ProgramState *MallocChecker::MallocMemAux(CheckerContext &C,  
@@ -252,7 +252,7 @@ void MallocChecker::FreeMem(CheckerContext &C, const CallExpr *CE) const {
   const ProgramState *state = FreeMemAux(C, CE, C.getState(), 0, false);
 
   if (state)
-    C.addTransition(state);
+    C.generateNode(state);
 }
 
 void MallocChecker::FreeMemAttr(CheckerContext &C, const CallExpr *CE,
@@ -265,7 +265,7 @@ void MallocChecker::FreeMemAttr(CheckerContext &C, const CallExpr *CE,
     const ProgramState *state = FreeMemAux(C, CE, C.getState(), *I,
                                       Att->getOwnKind() == OwnershipAttr::Holds);
     if (state)
-      C.addTransition(state);
+      C.generateNode(state);
   }
 }
 
@@ -531,7 +531,7 @@ void MallocChecker::ReallocMem(CheckerContext &C, const CallExpr *CE) const {
 
     const ProgramState *stateMalloc = MallocMemAux(C, CE, CE->getArg(1), 
                                               UndefinedVal(), stateEqual);
-    C.addTransition(stateMalloc);
+    C.generateNode(stateMalloc);
   }
 
   if (const ProgramState *stateNotEqual = state->assume(PtrEQ, false)) {
@@ -541,7 +541,7 @@ void MallocChecker::ReallocMem(CheckerContext &C, const CallExpr *CE) const {
           FreeMemAux(C, CE, stateSizeZero, 0, false)) {
 
         // Bind the return value to NULL because it is now free.
-        C.addTransition(stateFree->BindExpr(CE, svalBuilder.makeNull(), true));
+        C.generateNode(stateFree->BindExpr(CE, svalBuilder.makeNull(), true));
       }
     if (const ProgramState *stateSizeNotZero = stateNotEqual->assume(SizeZero,false))
       if (const ProgramState *stateFree = FreeMemAux(C, CE, stateSizeNotZero,
@@ -549,7 +549,7 @@ void MallocChecker::ReallocMem(CheckerContext &C, const CallExpr *CE) const {
         // FIXME: We should copy the content of the original buffer.
         const ProgramState *stateRealloc = MallocMemAux(C, CE, CE->getArg(1), 
                                                    UnknownVal(), stateFree);
-        C.addTransition(stateRealloc);
+        C.generateNode(stateRealloc);
       }
   }
 }
@@ -564,7 +564,7 @@ void MallocChecker::CallocMem(CheckerContext &C, const CallExpr *CE) {
                                         svalBuilder.getContext().getSizeType());  
   SVal zeroVal = svalBuilder.makeZeroVal(svalBuilder.getContext().CharTy);
 
-  C.addTransition(MallocMemAux(C, CE, TotalSize, zeroVal, state));
+  C.generateNode(MallocMemAux(C, CE, TotalSize, zeroVal, state));
 }
 
 void MallocChecker::checkDeadSymbols(SymbolReaper &SymReaper,
@@ -642,7 +642,7 @@ void MallocChecker::checkPreStmt(const ReturnStmt *S, CheckerContext &C) const {
   if (RS->isAllocated())
     state = state->set<RegionState>(Sym, RefState::getEscaped(S));
 
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 const ProgramState *MallocChecker::evalAssume(const ProgramState *state, SVal Cond, 
@@ -707,7 +707,7 @@ void MallocChecker::checkBind(SVal location, SVal val,
       // Generate a transition for 'nullState' to record the assumption
       // that the state was null.
       if (nullState)
-        C.addTransition(nullState);
+        C.generateNode(nullState);
 
       if (!notNullState)
         return;
@@ -735,7 +735,7 @@ void MallocChecker::checkBind(SVal location, SVal val,
         }
         while (false);
       }
-      C.addTransition(notNullState);
+      C.generateNode(notNullState);
     }
   }
 }
index 56789983593e936f3c5099912768de95b37aa908..92702ebb3daf518d9266753540b014d42428c98a 100644 (file)
@@ -193,7 +193,7 @@ template <typename T>
 static void setFlag(const ProgramState *state, SVal val, CheckerContext &C) {
   // We tag the symbol that the SVal wraps.
   if (SymbolRef sym = val.getAsSymbol())
-    C.addTransition(state->set<T>(sym, true));
+    C.generateNode(state->set<T>(sym, true));
 }
 
 static QualType parameterTypeFromSVal(SVal val, CheckerContext &C) {
index 3e4e07b65057b306b2f9d693f45f94c84aa2edaa..85ed86021c9d04a325dc136b26f55b79556bf168 100644 (file)
@@ -84,7 +84,7 @@ void ObjCAtSyncChecker::checkPreStmt(const ObjCAtSynchronizedStmt *S,
   }
 
   if (notNullState)
-    C.addTransition(notNullState);
+    C.generateNode(notNullState);
 }
 
 void ento::registerObjCAtSyncChecker(CheckerManager &mgr) {
index 8b29a20dc625fcab89227aff882460be9a5b9e7a..e480ec55d062ae86da1a3820758b55eeffc46a9d 100644 (file)
@@ -145,7 +145,7 @@ static void addSelfFlag(const ProgramState *state, SVal val,
                         SelfFlagEnum flag, CheckerContext &C) {
   // We tag the symbol that the SVal wraps.
   if (SymbolRef sym = val.getAsSymbol())
-    C.addTransition(state->set<SelfFlag>(sym, getSelfFlags(val, C) | flag));
+    C.generateNode(state->set<SelfFlag>(sym, getSelfFlags(val, C) | flag));
 }
 
 static bool hasSelfFlag(SVal val, SelfFlagEnum flag, CheckerContext &C) {
@@ -265,11 +265,11 @@ void ObjCSelfInitChecker::checkPreStmt(const CallExpr *CE,
     SVal argV = state->getSVal(*I);
     if (isSelfVar(argV, C)) {
       unsigned selfFlags = getSelfFlags(state->getSVal(cast<Loc>(argV)), C);
-      C.addTransition(state->set<PreCallSelfFlags>(selfFlags));
+      C.generateNode(state->set<PreCallSelfFlags>(selfFlags));
       return;
     } else if (hasSelfFlag(argV, SelfFlag_Self, C)) {
       unsigned selfFlags = getSelfFlags(argV, C);
-      C.addTransition(state->set<PreCallSelfFlags>(selfFlags));
+      C.generateNode(state->set<PreCallSelfFlags>(selfFlags));
       return;
     }
   }
index c02b5b14ca641e85354efe51e3acef02afb327af..c83e17c2685e0eb6c8d143450923b5f6dcbf3c2f 100644 (file)
@@ -141,7 +141,7 @@ void PthreadLockChecker::AcquireLock(CheckerContext &C, const CallExpr *CE,
       break;
     }
     assert(lockFail && lockSucc);
-    C.addTransition(lockFail);
+    C.generateNode(lockFail);
 
   } else if (semantics == PthreadSemantics) {
     // Assume that the return value was 0.
@@ -156,7 +156,7 @@ void PthreadLockChecker::AcquireLock(CheckerContext &C, const CallExpr *CE,
   
   // Record that the lock was acquired.  
   lockSucc = lockSucc->add<LockSet>(lockR);
-  C.addTransition(lockSucc);
+  C.generateNode(lockSucc);
 }
 
 void PthreadLockChecker::ReleaseLock(CheckerContext &C, const CallExpr *CE,
@@ -193,7 +193,7 @@ void PthreadLockChecker::ReleaseLock(CheckerContext &C, const CallExpr *CE,
 
   // Record that the lock was released. 
   state = state->set<LockSet>(LS.getTail());
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 
index c7d108b2f718e1c89b24052494f56cfddfb4d083..03096c1b9ce3c60fd6b088853c707a63cea1616e 100644 (file)
@@ -53,7 +53,7 @@ public:
   ExplodedNode *MakeNode(const ProgramState *state, ExplodedNode *Pred,
                          bool MarkAsSink = false) {
     assert(C);
-    return C->generateNode(state, Pred, tag, false, MarkAsSink);
+    return C->generateNode(state, Pred, tag, MarkAsSink);
   }
 };
 } // end anonymous namespace
@@ -2517,7 +2517,7 @@ void RetainCountChecker::checkPostStmt(const BlockExpr *BE,
   state =
     state->scanReachableSymbols<StopTrackingCallback>(Regions.data(),
                                     Regions.data() + Regions.size()).getState();
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void RetainCountChecker::checkPostStmt(const CastExpr *CE,
@@ -3047,7 +3047,7 @@ bool RetainCountChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
       state = state->set<RefBindings>(Sym, *Binding);
   }
 
-  C.addTransition(state);
+  C.generateNode(state);
   return true;
 }
 
@@ -3252,7 +3252,7 @@ void RetainCountChecker::checkBind(SVal loc, SVal val, const Stmt *S,
   // Otherwise, find all symbols referenced by 'val' that we are tracking
   // and stop tracking them.
   state = state->scanReachableSymbols<StopTrackingCallback>(val).getState();
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 const ProgramState *RetainCountChecker::evalAssume(const ProgramState *state,
index 8010e8dbaca0e6e16235b817fbfe71de91809106..36b1e71ac565b58b99fdc77a58f53e7ef80bf04a 100644 (file)
@@ -241,15 +241,15 @@ void StreamChecker::OpenFileAux(CheckerContext &C, const CallExpr *CE) const {
     stateNull =
       stateNull->set<StreamState>(Sym, StreamState::getOpenFailed(CE));
 
-    C.addTransition(stateNotNull);
-    C.addTransition(stateNull);
+    C.generateNode(stateNotNull);
+    C.generateNode(stateNull);
   }
 }
 
 void StreamChecker::Fclose(CheckerContext &C, const CallExpr *CE) const {
   const ProgramState *state = CheckDoubleClose(CE, C.getState(), C);
   if (state)
-    C.addTransition(state);
+    C.generateNode(state);
 }
 
 void StreamChecker::Fread(CheckerContext &C, const CallExpr *CE) const {
@@ -457,7 +457,7 @@ void StreamChecker::checkPreStmt(const ReturnStmt *S, CheckerContext &C) const {
   if (SS->isOpened())
     state = state->set<StreamState>(Sym, StreamState::getEscaped(S));
 
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void ento::registerStreamChecker(CheckerManager &mgr) {
index cec286d2f3e97d2a75baa7a1b1f69a5b036232f9..87f532a774a6e3c6772e0c2c8e0b95a90bfb2477 100644 (file)
@@ -215,7 +215,7 @@ void UnixAPIChecker::CheckMallocZero(CheckerContext &C,
   // Assume the the value is non-zero going forward.
   assert(trueState);
   if (trueState != state) {
-    C.addTransition(trueState);
+    C.generateNode(trueState);
   }
 }
   
index b34b97c5b301b550c365380a17c5c948cea4a182..7e4dfc57d265c8aac67a86ef2a41285cfb769518 100644 (file)
@@ -129,7 +129,7 @@ void VLASizeChecker::checkPreStmt(const DeclStmt *DS, CheckerContext &C) const {
   assert(state);
 
   // Remember our assumptions!
-  C.addTransition(state);
+  C.generateNode(state);
 }
 
 void ento::registerVLASizeChecker(CheckerManager &mgr) {
index ecb1a7a4ce3aa8eb50d42888dbb9093c0e14b72f..a3d2bfd5fe2ce272d7d780e5af76565a8a1bcfc5 100644 (file)
@@ -153,7 +153,7 @@ namespace {
                                            ProgramPoint::PostStmtKind;
       const ProgramPoint &L = ProgramPoint::getProgramPoint(S, K,
                                 Pred->getLocationContext(), checkFn.Checker);
-      CheckerContext C(Bldr, Eng, Pred, L, 0);
+      CheckerContext C(Bldr, Eng, Pred, L);
 
       checkFn(S, C);
     }
@@ -192,7 +192,7 @@ namespace {
                                            ProgramPoint::PostStmtKind;
       const ProgramPoint &L = ProgramPoint::getProgramPoint(Msg.getOriginExpr(),
                                 K, Pred->getLocationContext(), checkFn.Checker);
-      CheckerContext C(Bldr, Eng, Pred, L, 0);
+      CheckerContext C(Bldr, Eng, Pred, L);
 
       checkFn(Msg, C);
     }
@@ -234,7 +234,7 @@ namespace {
                                        ProgramPoint::PreStoreKind;
       const ProgramPoint &L = ProgramPoint::getProgramPoint(S, K,
                                 Pred->getLocationContext(), checkFn.Checker);
-      CheckerContext C(Bldr, Eng, Pred, L, 0);
+      CheckerContext C(Bldr, Eng, Pred, L);
 
       checkFn(Loc, IsLoad, S, C);
     }
@@ -273,7 +273,7 @@ namespace {
                     NodeBuilder &Bldr, ExplodedNode *Pred) {
       const ProgramPoint &L = ProgramPoint::getProgramPoint(S, PointKind,
                                 Pred->getLocationContext(), checkFn.Checker);
-      CheckerContext C(Bldr, Eng, Pred, L, 0);
+      CheckerContext C(Bldr, Eng, Pred, L);
 
       checkFn(Loc, Val, S, C);
     }
@@ -315,7 +315,7 @@ void CheckerManager::runCheckersForEndPath(NodeBuilderContext &BC,
     const ProgramPoint &L = BlockEntrance(BC.Block,
                                           Pred->getLocationContext(),
                                           checkFn.Checker);
-    CheckerContext C(Bldr, Eng, Pred, L, 0);
+    CheckerContext C(Bldr, Eng, Pred, L);
     checkFn(C);
   }
 }
@@ -338,7 +338,7 @@ namespace {
                     NodeBuilder &Bldr, ExplodedNode *Pred) {
       ProgramPoint L = PostCondition(Condition, Pred->getLocationContext(),
                                      checkFn.Checker);
-      CheckerContext C(Bldr, Eng, Pred, L, 0);
+      CheckerContext C(Bldr, Eng, Pred, L);
       checkFn(Condition, C);
     }
   };
@@ -382,7 +382,7 @@ namespace {
       ProgramPoint::Kind K = ProgramPoint::PostPurgeDeadSymbolsKind;
       const ProgramPoint &L = ProgramPoint::getProgramPoint(S, K,
                                 Pred->getLocationContext(), checkFn.Checker);
-      CheckerContext C(Bldr, Eng, Pred, L, 0);
+      CheckerContext C(Bldr, Eng, Pred, L);
 
       checkFn(SR, C);
     }
@@ -500,7 +500,7 @@ void CheckerManager::runCheckersForEvalCall(ExplodedNodeSet &Dst,
       { // CheckerContext generates transitions(populates checkDest) on
         // destruction, so introduce the scope to make sure it gets properly
         // populated.
-        CheckerContext C(B, Eng, Pred, L, 0);
+        CheckerContext C(B, Eng, Pred, L);
         evaluated = (*EI)(CE, C);
       }
       assert(!(evaluated && anyEvaluated)