[cfe-commits] r142946 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/ lib/StaticAnalyzer/Checkers/ lib/StaticAnalyzer/Core/
Anna Zaks
ganna at apple.com
Tue Oct 25 12:57:06 PDT 2011
Author: zaks
Date: Tue Oct 25 14:57:06 2011
New Revision: 142946
URL: http://llvm.org/viewvc/llvm-project?rev=142946&view=rev
Log:
[analyzer] Simplify CheckerContext
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)?
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h Tue Oct 25 14:57:06 2011
@@ -24,25 +24,17 @@
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 @@
}
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 @@
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 @@
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);
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp Tue Oct 25 14:57:06 2011
@@ -84,8 +84,7 @@
// 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) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp Tue Oct 25 14:57:06 2011
@@ -125,7 +125,7 @@
// 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) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp Tue Oct 25 14:57:06 2011
@@ -421,7 +421,7 @@
}
// From here on, we know the argument is non-null.
- C.addTransition(stateFalse);
+ C.generateNode(stateFalse);
}
//===----------------------------------------------------------------------===//
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CStringChecker.cpp Tue Oct 25 14:57:06 2011
@@ -859,7 +859,7 @@
// 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 @@
// 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 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
// 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 @@
// 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 @@
}
// Record this as a possible path.
- C.addTransition(state);
+ C.generateNode(state);
}
//===----------------------------------------------------------------------===//
@@ -1746,7 +1746,7 @@
state = state->set<CStringLength>(MR, strLength);
}
- C.addTransition(state);
+ C.generateNode(state);
}
bool CStringChecker::wantsRegionChangeUpdate(const ProgramState *state) const {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp Tue Oct 25 14:57:06 2011
@@ -312,7 +312,7 @@
// 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 @@
return;
}
- C.addTransition(state);
+ C.generateNode(state);
}
void ento::registerCallAndMessageChecker(CheckerManager &mgr) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp Tue Oct 25 14:57:06 2011
@@ -94,7 +94,7 @@
// 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 @@
}
}
- C.addTransition(state);
+ C.generateNode(state);
}
// Check the jail state before any function call except chroot and chdir().
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp Tue Oct 25 14:57:06 2011
@@ -184,7 +184,7 @@
}
// From this point forward, we know that the location is not null.
- C.addTransition(notNullState);
+ C.generateNode(notNullState);
}
void ento::registerDereferenceChecker(CheckerManager &mgr) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp Tue Oct 25 14:57:06 2011
@@ -73,7 +73,7 @@
// 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) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/IteratorsChecker.cpp Tue Oct 25 14:57:06 2011
@@ -472,7 +472,7 @@
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 @@
}
}
}
- C.addTransition(state);
+ C.generateNode(state);
}
@@ -600,6 +600,6 @@
state = state->add<CalledReserved>(MR);
if (state != C.getState())
- C.addTransition(state);
+ C.generateNode(state);
}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp Tue Oct 25 14:57:06 2011
@@ -400,7 +400,7 @@
// 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 @@
return;
}
- C.addTransition(State);
+ C.generateNode(State);
}
void MacOSKeychainAPIChecker::checkPostStmt(const CallExpr *CE,
@@ -482,7 +482,7 @@
State = State->set<AllocatedData>(V, AllocationState(ArgExpr, idx,
RetStatusSymbol));
assert(State);
- C.addTransition(State);
+ C.generateNode(State);
}
}
@@ -500,7 +500,7 @@
state = state->remove<AllocatedData>(getSymbolForRegion(C, V));
// Proceed from the new state.
- C.addTransition(state);
+ C.generateNode(state);
}
BugReport *MacOSKeychainAPIChecker::
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/MallocChecker.cpp Tue Oct 25 14:57:06 2011
@@ -197,7 +197,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
// 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 @@
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 @@
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 @@
// 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 @@
}
while (false);
}
- C.addTransition(notNullState);
+ C.generateNode(notNullState);
}
}
}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp Tue Oct 25 14:57:06 2011
@@ -193,7 +193,7 @@
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) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp Tue Oct 25 14:57:06 2011
@@ -84,7 +84,7 @@
}
if (notNullState)
- C.addTransition(notNullState);
+ C.generateNode(notNullState);
}
void ento::registerObjCAtSyncChecker(CheckerManager &mgr) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp Tue Oct 25 14:57:06 2011
@@ -145,7 +145,7 @@
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 @@
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;
}
}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp Tue Oct 25 14:57:06 2011
@@ -141,7 +141,7 @@
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 @@
// 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 @@
// Record that the lock was released.
state = state->set<LockSet>(LS.getTail());
- C.addTransition(state);
+ C.generateNode(state);
}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp Tue Oct 25 14:57:06 2011
@@ -53,7 +53,7 @@
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 @@
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 @@
state = state->set<RefBindings>(Sym, *Binding);
}
- C.addTransition(state);
+ C.generateNode(state);
return true;
}
@@ -3252,7 +3252,7 @@
// 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,
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/StreamChecker.cpp Tue Oct 25 14:57:06 2011
@@ -241,15 +241,15 @@
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 @@
if (SS->isOpened())
state = state->set<StreamState>(Sym, StreamState::getEscaped(S));
- C.addTransition(state);
+ C.generateNode(state);
}
void ento::registerStreamChecker(CheckerManager &mgr) {
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp Tue Oct 25 14:57:06 2011
@@ -215,7 +215,7 @@
// Assume the the value is non-zero going forward.
assert(trueState);
if (trueState != state) {
- C.addTransition(trueState);
+ C.generateNode(trueState);
}
}
Modified: cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp Tue Oct 25 14:57:06 2011
@@ -129,7 +129,7 @@
assert(state);
// Remember our assumptions!
- C.addTransition(state);
+ C.generateNode(state);
}
void ento::registerVLASizeChecker(CheckerManager &mgr) {
Modified: cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp?rev=142946&r1=142945&r2=142946&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/CheckerManager.cpp Tue Oct 25 14:57:06 2011
@@ -153,7 +153,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
{ // 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)
More information about the cfe-commits
mailing list