aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Checker/PathSensitive/ConstraintManager.h8
-rw-r--r--include/clang/Checker/PathSensitive/GRState.h26
-rw-r--r--lib/Checker/ArrayBoundChecker.cpp4
-rw-r--r--lib/Checker/AttrNonNullChecker.cpp2
-rw-r--r--lib/Checker/BasicConstraintManager.cpp28
-rw-r--r--lib/Checker/BasicObjCFoundationChecks.cpp2
-rw-r--r--lib/Checker/BugReporterVisitors.cpp6
-rw-r--r--lib/Checker/BuiltinFunctionChecker.cpp2
-rw-r--r--lib/Checker/CFRefCount.cpp4
-rw-r--r--lib/Checker/CStringChecker.cpp28
-rw-r--r--lib/Checker/DereferenceChecker.cpp2
-rw-r--r--lib/Checker/DivZeroChecker.cpp2
-rw-r--r--lib/Checker/GRExprEngine.cpp31
-rw-r--r--lib/Checker/GRState.cpp4
-rw-r--r--lib/Checker/MallocChecker.cpp14
-rw-r--r--lib/Checker/OSAtomicChecker.cpp4
-rw-r--r--lib/Checker/ObjCAtSyncChecker.cpp2
-rw-r--r--lib/Checker/PthreadLockChecker.cpp4
-rw-r--r--lib/Checker/RangeConstraintManager.cpp26
-rw-r--r--lib/Checker/ReturnPointerRangeChecker.cpp4
-rw-r--r--lib/Checker/SimpleConstraintManager.cpp48
-rw-r--r--lib/Checker/SimpleConstraintManager.h24
-rw-r--r--lib/Checker/StreamChecker.cpp4
-rw-r--r--lib/Checker/UnixAPIChecker.cpp4
-rw-r--r--lib/Checker/VLASizeChecker.cpp6
25 files changed, 145 insertions, 144 deletions
diff --git a/include/clang/Checker/PathSensitive/ConstraintManager.h b/include/clang/Checker/PathSensitive/ConstraintManager.h
index 97535f55bf..fe37291279 100644
--- a/include/clang/Checker/PathSensitive/ConstraintManager.h
+++ b/include/clang/Checker/PathSensitive/ConstraintManager.h
@@ -31,13 +31,13 @@ class SVal;
class ConstraintManager {
public:
virtual ~ConstraintManager();
- virtual const GRState *Assume(const GRState *state, DefinedSVal Cond,
+ virtual const GRState *assume(const GRState *state, DefinedSVal Cond,
bool Assumption) = 0;
- std::pair<const GRState*, const GRState*> AssumeDual(const GRState *state,
+ std::pair<const GRState*, const GRState*> assumeDual(const GRState *state,
DefinedSVal Cond) {
- return std::make_pair(Assume(state, Cond, true),
- Assume(state, Cond, false));
+ return std::make_pair(assume(state, Cond, true),
+ assume(state, Cond, false));
}
virtual const llvm::APSInt* getSymVal(const GRState *state,
diff --git a/include/clang/Checker/PathSensitive/GRState.h b/include/clang/Checker/PathSensitive/GRState.h
index 8127649d77..c59842f88d 100644
--- a/include/clang/Checker/PathSensitive/GRState.h
+++ b/include/clang/Checker/PathSensitive/GRState.h
@@ -156,30 +156,30 @@ public:
// could satisfy all the constraints). This is the principal mechanism
// for modeling path-sensitivity in GRExprEngine/GRState.
//
- // Various "Assume" methods form the interface for adding constraints to
- // symbolic values. A call to "Assume" indicates an assumption being placed
- // on one or symbolic values. Assume methods take the following inputs:
+ // Various "assume" methods form the interface for adding constraints to
+ // symbolic values. A call to 'assume' indicates an assumption being placed
+ // on one or symbolic values. 'assume' methods take the following inputs:
//
// (1) A GRState object representing the current state.
//
- // (2) The assumed constraint (which is specific to a given "Assume" method).
+ // (2) The assumed constraint (which is specific to a given "assume" method).
//
// (3) A binary value "Assumption" that indicates whether the constraint is
// assumed to be true or false.
//
- // The output of "Assume*" is a new GRState object with the added constraints.
+ // The output of "assume*" is a new GRState object with the added constraints.
// If no new state is feasible, NULL is returned.
//
- const GRState *Assume(DefinedOrUnknownSVal cond, bool assumption) const;
+ const GRState *assume(DefinedOrUnknownSVal cond, bool assumption) const;
/// This method assumes both "true" and "false" for 'cond', and
/// returns both corresponding states. It's shorthand for doing
- /// 'Assume' twice.
+ /// 'assume' twice.
std::pair<const GRState*, const GRState*>
- Assume(DefinedOrUnknownSVal cond) const;
+ assume(DefinedOrUnknownSVal cond) const;
- const GRState *AssumeInBound(DefinedOrUnknownSVal idx,
+ const GRState *assumeInBound(DefinedOrUnknownSVal idx,
DefinedOrUnknownSVal upperBound,
bool assumption) const;
@@ -603,21 +603,21 @@ inline const VarRegion* GRState::getRegion(const VarDecl *D,
return getStateManager().getRegionManager().getVarRegion(D, LC);
}
-inline const GRState *GRState::Assume(DefinedOrUnknownSVal Cond,
+inline const GRState *GRState::assume(DefinedOrUnknownSVal Cond,
bool Assumption) const {
if (Cond.isUnknown())
return this;
- return getStateManager().ConstraintMgr->Assume(this, cast<DefinedSVal>(Cond),
+ return getStateManager().ConstraintMgr->assume(this, cast<DefinedSVal>(Cond),
Assumption);
}
inline std::pair<const GRState*, const GRState*>
-GRState::Assume(DefinedOrUnknownSVal Cond) const {
+GRState::assume(DefinedOrUnknownSVal Cond) const {
if (Cond.isUnknown())
return std::make_pair(this, this);
- return getStateManager().ConstraintMgr->AssumeDual(this,
+ return getStateManager().ConstraintMgr->assumeDual(this,
cast<DefinedSVal>(Cond));
}
diff --git a/lib/Checker/ArrayBoundChecker.cpp b/lib/Checker/ArrayBoundChecker.cpp
index dccb9a2952..fe532a2b1d 100644
--- a/lib/Checker/ArrayBoundChecker.cpp
+++ b/lib/Checker/ArrayBoundChecker.cpp
@@ -63,8 +63,8 @@ void ArrayBoundChecker::VisitLocation(CheckerContext &C, const Stmt *S, SVal l){
= C.getStoreManager().getSizeInElements(state, ER->getSuperRegion(),
ER->getValueType());
- const GRState *StInBound = state->AssumeInBound(Idx, NumElements, true);
- const GRState *StOutBound = state->AssumeInBound(Idx, NumElements, false);
+ const GRState *StInBound = state->assumeInBound(Idx, NumElements, true);
+ const GRState *StOutBound = state->assumeInBound(Idx, NumElements, false);
if (StOutBound && !StInBound) {
ExplodedNode *N = C.GenerateSink(StOutBound);
if (!N)
diff --git a/lib/Checker/AttrNonNullChecker.cpp b/lib/Checker/AttrNonNullChecker.cpp
index 54b7b72d43..28f79c4a15 100644
--- a/lib/Checker/AttrNonNullChecker.cpp
+++ b/lib/Checker/AttrNonNullChecker.cpp
@@ -91,7 +91,7 @@ void AttrNonNullChecker::PreVisitCallExpr(CheckerContext &C,
ConstraintManager &CM = C.getConstraintManager();
const GRState *stateNotNull, *stateNull;
- llvm::tie(stateNotNull, stateNull) = CM.AssumeDual(state, *DV);
+ llvm::tie(stateNotNull, stateNull) = CM.assumeDual(state, *DV);
if (stateNull && !stateNotNull) {
// Generate an error node. Check for a null node in case
diff --git a/lib/Checker/BasicConstraintManager.cpp b/lib/Checker/BasicConstraintManager.cpp
index b8da6b71af..862b59babd 100644
--- a/lib/Checker/BasicConstraintManager.cpp
+++ b/lib/Checker/BasicConstraintManager.cpp
@@ -53,27 +53,27 @@ public:
: SimpleConstraintManager(subengine),
ISetFactory(statemgr.getAllocator()) {}
- const GRState* AssumeSymNE(const GRState* state, SymbolRef sym,
+ const GRState *assumeSymNE(const GRState* state, SymbolRef sym,
const llvm::APSInt& V,
const llvm::APSInt& Adjustment);
- const GRState* AssumeSymEQ(const GRState* state, SymbolRef sym,
+ const GRState *assumeSymEQ(const GRState* state, SymbolRef sym,
const llvm::APSInt& V,
const llvm::APSInt& Adjustment);
- const GRState* AssumeSymLT(const GRState* state, SymbolRef sym,
+ const GRState *assumeSymLT(const GRState* state, SymbolRef sym,
const llvm::APSInt& V,
const llvm::APSInt& Adjustment);
- const GRState* AssumeSymGT(const GRState* state, SymbolRef sym,
+ const GRState *assumeSymGT(const GRState* state, SymbolRef sym,
const llvm::APSInt& V,
const llvm::APSInt& Adjustment);
- const GRState* AssumeSymGE(const GRState* state, SymbolRef sym,
+ const GRState *assumeSymGE(const GRState* state, SymbolRef sym,
const llvm::APSInt& V,
const llvm::APSInt& Adjustment);
- const GRState* AssumeSymLE(const GRState* state, SymbolRef sym,
+ const GRState *assumeSymLE(const GRState* state, SymbolRef sym,
const llvm::APSInt& V,
const llvm::APSInt& Adjustment);
@@ -102,7 +102,7 @@ ConstraintManager* clang::CreateBasicConstraintManager(GRStateManager& statemgr,
const GRState*
-BasicConstraintManager::AssumeSymNE(const GRState *state, SymbolRef sym,
+BasicConstraintManager::assumeSymNE(const GRState *state, SymbolRef sym,
const llvm::APSInt &V,
const llvm::APSInt &Adjustment) {
// First, determine if sym == X, where X+Adjustment != V.
@@ -122,7 +122,7 @@ BasicConstraintManager::AssumeSymNE(const GRState *state, SymbolRef sym,
}
const GRState*
-BasicConstraintManager::AssumeSymEQ(const GRState *state, SymbolRef sym,
+BasicConstraintManager::assumeSymEQ(const GRState *state, SymbolRef sym,
const llvm::APSInt &V,
const llvm::APSInt &Adjustment) {
// First, determine if sym == X, where X+Adjustment != V.
@@ -143,7 +143,7 @@ BasicConstraintManager::AssumeSymEQ(const GRState *state, SymbolRef sym,
// The logic for these will be handled in another ConstraintManager.
const GRState*
-BasicConstraintManager::AssumeSymLT(const GRState *state, SymbolRef sym,
+BasicConstraintManager::assumeSymLT(const GRState *state, SymbolRef sym,
const llvm::APSInt &V,
const llvm::APSInt &Adjustment) {
// Is 'V' the smallest possible value?
@@ -153,11 +153,11 @@ BasicConstraintManager::AssumeSymLT(const GRState *state, SymbolRef sym,
}
// FIXME: For now have assuming x < y be the same as assuming sym != V;
- return AssumeSymNE(state, sym, V, Adjustment);
+ return assumeSymNE(state, sym, V, Adjustment);
}
const GRState*
-BasicConstraintManager::AssumeSymGT(const GRState *state, SymbolRef sym,
+BasicConstraintManager::assumeSymGT(const GRState *state, SymbolRef sym,
const llvm::APSInt &V,
const llvm::APSInt &Adjustment) {
// Is 'V' the largest possible value?
@@ -167,11 +167,11 @@ BasicConstraintManager::AssumeSymGT(const GRState *state, SymbolRef sym,
}
// FIXME: For now have assuming x > y be the same as assuming sym != V;
- return AssumeSymNE(state, sym, V, Adjustment);
+ return assumeSymNE(state, sym, V, Adjustment);
}
const GRState*
-BasicConstraintManager::AssumeSymGE(const GRState *state, SymbolRef sym,
+BasicConstraintManager::assumeSymGE(const GRState *state, SymbolRef sym,
const llvm::APSInt &V,
const llvm::APSInt &Adjustment) {
// Reject a path if the value of sym is a constant X and !(X+Adj >= V).
@@ -199,7 +199,7 @@ BasicConstraintManager::AssumeSymGE(const GRState *state, SymbolRef sym,
}
const GRState*
-BasicConstraintManager::AssumeSymLE(const GRState *state, SymbolRef sym,
+BasicConstraintManager::assumeSymLE(const GRState *state, SymbolRef sym,
const llvm::APSInt &V,
const llvm::APSInt &Adjustment) {
// Reject a path if the value of sym is a constant X and !(X+Adj <= V).
diff --git a/lib/Checker/BasicObjCFoundationChecks.cpp b/lib/Checker/BasicObjCFoundationChecks.cpp
index 5db957fcfb..1e48b1ad44 100644
--- a/lib/Checker/BasicObjCFoundationChecks.cpp
+++ b/lib/Checker/BasicObjCFoundationChecks.cpp
@@ -418,7 +418,7 @@ void CFRetainReleaseChecker::PreVisitCallExpr(CheckerContext& C,
// Are they equal?
const GRState *stateTrue, *stateFalse;
- llvm::tie(stateTrue, stateFalse) = state->Assume(ArgIsNull);
+ llvm::tie(stateTrue, stateFalse) = state->assume(ArgIsNull);
if (stateTrue && !stateFalse) {
ExplodedNode *N = C.GenerateSink(stateTrue);
diff --git a/lib/Checker/BugReporterVisitors.cpp b/lib/Checker/BugReporterVisitors.cpp
index 91cf349107..d466abe068 100644
--- a/lib/Checker/BugReporterVisitors.cpp
+++ b/lib/Checker/BugReporterVisitors.cpp
@@ -252,14 +252,14 @@ public:
// Check if in the previous state it was feasible for this constraint
// to *not* be true.
- if (PrevN->getState()->Assume(Constraint, !Assumption)) {
+ if (PrevN->getState()->assume(Constraint, !Assumption)) {
isSatisfied = true;
// As a sanity check, make sure that the negation of the constraint
// was infeasible in the current state. If it is feasible, we somehow
// missed the transition point.
- if (N->getState()->Assume(Constraint, !Assumption))
+ if (N->getState()->assume(Constraint, !Assumption))
return NULL;
// We found the transition point for the constraint. We now need to
@@ -400,7 +400,7 @@ public:
const DefinedOrUnknownSVal *DV = dyn_cast<DefinedOrUnknownSVal>(&V);
if (!DV)
return 0;
- state = state->Assume(*DV, true);
+ state = state->assume(*DV, true);
if (state)
return 0;
diff --git a/lib/Checker/BuiltinFunctionChecker.cpp b/lib/Checker/BuiltinFunctionChecker.cpp
index a43a28449b..13875732ef 100644
--- a/lib/Checker/BuiltinFunctionChecker.cpp
+++ b/lib/Checker/BuiltinFunctionChecker.cpp
@@ -73,7 +73,7 @@ bool BuiltinFunctionChecker::evalCallExpr(CheckerContext &C,const CallExpr *CE){
SValBuilder& svalBuilder = ValMgr.getSValBuilder();
DefinedOrUnknownSVal ExtentMatchesSizeArg =
svalBuilder.evalEQ(state, Extent, Size);
- state = state->Assume(ExtentMatchesSizeArg, true);
+ state = state->assume(ExtentMatchesSizeArg, true);
C.GenerateNode(state->BindExpr(CE, loc::MemRegionVal(R)));
return true;
diff --git a/lib/Checker/CFRefCount.cpp b/lib/Checker/CFRefCount.cpp
index a1eff948c7..0be30b61db 100644
--- a/lib/Checker/CFRefCount.cpp
+++ b/lib/Checker/CFRefCount.cpp
@@ -1283,7 +1283,7 @@ RetainSummaryManager::getCommonMethodSummary(const ObjCMethodDecl* MD,
// Look for methods that return an owned object.
if (cocoa::isCocoaObjectRef(RetTy)) {
- // EXPERIMENTAL: Assume the Cocoa conventions for all objects returned
+ // EXPERIMENTAL: assume the Cocoa conventions for all objects returned
// by instance methods.
RetEffect E = cocoa::followsFundamentalRule(S)
? ObjCAllocRetE : RetEffect::MakeNotOwned(RetEffect::ObjC);
@@ -2725,7 +2725,7 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst,
#if 0
if (RE.getKind() == RetEffect::OwnedAllocatedSymbol) {
bool isFeasible;
- state = state.Assume(loc::SymbolVal(Sym), true, isFeasible);
+ state = state.assume(loc::SymbolVal(Sym), true, isFeasible);
assert(isFeasible && "Cannot assume fresh symbol is non-null.");
}
#endif
diff --git a/lib/Checker/CStringChecker.cpp b/lib/Checker/CStringChecker.cpp
index 2454668f5d..a177710c17 100644
--- a/lib/Checker/CStringChecker.cpp
+++ b/lib/Checker/CStringChecker.cpp
@@ -59,7 +59,7 @@ public:
// Utility methods
std::pair<const GRState*, const GRState*>
- AssumeZero(CheckerContext &C, const GRState *state, SVal V, QualType Ty);
+ assumeZero(CheckerContext &C, const GRState *state, SVal V, QualType Ty);
const GRState *SetCStringLength(const GRState *state, const MemRegion *MR,
SVal StrLen);
@@ -115,7 +115,7 @@ void clang::RegisterCStringChecker(GRExprEngine &Eng) {
//===----------------------------------------------------------------------===//
std::pair<const GRState*, const GRState*>
-CStringChecker::AssumeZero(CheckerContext &C, const GRState *state, SVal V,
+CStringChecker::assumeZero(CheckerContext &C, const GRState *state, SVal V,
QualType Ty) {
DefinedSVal *Val = dyn_cast<DefinedSVal>(&V);
if (!Val)
@@ -127,7 +127,7 @@ CStringChecker::AssumeZero(CheckerContext &C, const GRState *state, SVal V,
DefinedOrUnknownSVal Zero = ValMgr.makeZeroVal(Ty);
DefinedOrUnknownSVal ValIsZero = SV.evalEQ(state, *Val, Zero);
- return state->Assume(ValIsZero);
+ return state->assume(ValIsZero);
}
const GRState *CStringChecker::CheckNonNull(CheckerContext &C,
@@ -138,7 +138,7 @@ const GRState *CStringChecker::CheckNonNull(CheckerContext &C,
return NULL;
const GRState *stateNull, *stateNonNull;
- llvm::tie(stateNull, stateNonNull) = AssumeZero(C, state, l, S->getType());
+ llvm::tie(stateNull, stateNonNull) = assumeZero(C, state, l, S->getType());
if (stateNull && !stateNonNull) {
ExplodedNode *N = C.GenerateSink(stateNull);
@@ -195,8 +195,8 @@ const GRState *CStringChecker::CheckLocation(CheckerContext &C,
// Get the index of the accessed element.
DefinedOrUnknownSVal Idx = cast<DefinedOrUnknownSVal>(ER->getIndex());
- const GRState *StInBound = state->AssumeInBound(Idx, Size, true);
- const GRState *StOutBound = state->AssumeInBound(Idx, Size, false);
+ const GRState *StInBound = state->assumeInBound(Idx, Size, true);
+ const GRState *StOutBound = state->assumeInBound(Idx, Size, false);
if (StOutBound && !StInBound) {
ExplodedNode *N = C.GenerateSink(StOutBound);
if (!N)
@@ -331,7 +331,7 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
// Are the two values the same?
DefinedOrUnknownSVal EqualTest = SV.evalEQ(state, *FirstLoc, *SecondLoc);
- llvm::tie(stateTrue, stateFalse) = state->Assume(EqualTest);
+ llvm::tie(stateTrue, stateFalse) = state->assume(EqualTest);
if (stateTrue && !stateFalse) {
// If the values are known to be equal, that's automatically an overlap.
@@ -339,7 +339,7 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
return NULL;
}
- // Assume the two expressions are not equal.
+ // assume the two expressions are not equal.
assert(stateFalse);
state = stateFalse;
@@ -351,7 +351,7 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
if (!ReverseTest)
return state;
- llvm::tie(stateTrue, stateFalse) = state->Assume(*ReverseTest);
+ llvm::tie(stateTrue, stateFalse) = state->assume(*ReverseTest);
if (stateTrue) {
if (stateFalse) {
@@ -398,7 +398,7 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
if (!OverlapTest)
return state;
- llvm::tie(stateTrue, stateFalse) = state->Assume(*OverlapTest);
+ llvm::tie(stateTrue, stateFalse) = state->assume(*OverlapTest);
if (stateTrue && !stateFalse) {
// Overlap!
@@ -406,7 +406,7 @@ const GRState *CStringChecker::CheckOverlap(CheckerContext &C,
return NULL;
}
- // Assume the two expressions don't overlap.
+ // assume the two expressions don't overlap.
assert(stateFalse);
return stateFalse;
}
@@ -658,7 +658,7 @@ void CStringChecker::evalCopyCommon(CheckerContext &C, const GRState *state,
QualType SizeTy = Size->getType();
const GRState *StZeroSize, *StNonZeroSize;
- llvm::tie(StZeroSize, StNonZeroSize) = AssumeZero(C, state, SizeVal, SizeTy);
+ llvm::tie(StZeroSize, StNonZeroSize) = assumeZero(C, state, SizeVal, SizeTy);
// If the size is zero, there won't be any actual memory access.
if (StZeroSize)
@@ -723,7 +723,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) {
QualType SizeTy = Size->getType();
const GRState *StZeroSize, *StNonZeroSize;
- llvm::tie(StZeroSize, StNonZeroSize) = AssumeZero(C, state, SizeVal, SizeTy);
+ llvm::tie(StZeroSize, StNonZeroSize) = assumeZero(C, state, SizeVal, SizeTy);
// If the size can be zero, the result will be 0 in that case, and we don't
// have to check either of the buffers.
@@ -746,7 +746,7 @@ void CStringChecker::evalMemcmp(CheckerContext &C, const CallExpr *CE) {
// See if they are the same.
DefinedOrUnknownSVal SameBuf = SV.evalEQ(state, LV, RV);
const GRState *StSameBuf, *StNotSameBuf;
- llvm::tie(StSameBuf, StNotSameBuf) = state->Assume(SameBuf);
+ llvm::tie(StSameBuf, StNotSameBuf) = state->assume(SameBuf);
// If the two arguments might be the same buffer, we know the result is zero,
// and we only need to check one size.
diff --git a/lib/Checker/DereferenceChecker.cpp b/lib/Checker/DereferenceChecker.cpp
index bb40a84cb0..747fcbe311 100644
--- a/lib/Checker/DereferenceChecker.cpp
+++ b/lib/Checker/DereferenceChecker.cpp
@@ -107,7 +107,7 @@ void DereferenceChecker::VisitLocation(CheckerContext &C, const Stmt *S,
const GRState *state = C.getState();
const GRState *notNullState, *nullState;
- llvm::tie(notNullState, nullState) = state->Assume(location);
+ llvm::tie(notNullState, nullState) = state->assume(location);
// The explicit NULL case.
if (nullState) {
diff --git a/lib/Checker/DivZeroChecker.cpp b/lib/Checker/DivZeroChecker.cpp
index 32e2a1782d..d795800d6f 100644
--- a/lib/Checker/DivZeroChecker.cpp
+++ b/lib/Checker/DivZeroChecker.cpp
@@ -61,7 +61,7 @@ void DivZeroChecker::PreVisitBinaryOperator(CheckerContext &C,
// Check for divide by zero.
ConstraintManager &CM = C.getConstraintManager();
const GRState *stateNotZero, *stateZero;
- llvm::tie(stateNotZero, stateZero) = CM.AssumeDual(C.getState(), *DV);
+ llvm::tie(stateNotZero, stateZero) = CM.assumeDual(C.getState(), *DV);
if (stateZero && !stateNotZero) {
if (ExplodedNode *N = C.GenerateSink(stateZero)) {
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index 1afad76558..a552447b30 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -392,7 +392,7 @@ const GRState* GRExprEngine::getInitialState(const LocationContext *InitLoc) {
if (!Constraint)
break;
- if (const GRState *newState = state->Assume(*Constraint, true))
+ if (const GRState *newState = state->assume(*Constraint, true))
state = newState;
break;
@@ -407,7 +407,7 @@ const GRState* GRExprEngine::getInitialState(const LocationContext *InitLoc) {
if (const Loc *LV = dyn_cast<Loc>(&V)) {
// Assume that the pointer value in 'self' is non-null.
- state = state->Assume(*LV, true);
+ state = state->assume(*LV, true);
assert(state && "'self' cannot be null");
}
}
@@ -458,13 +458,14 @@ const GRState *GRExprEngine::ProcessAssume(const GRState *state, SVal cond,
state = C->evalAssume(state, cond, assumption, &respondsToCallback);
- // Check if we're building the cache of checkers that care about Assumes.
+ // Check if we're building the cache of checkers that care about
+ // assumptions.
if (NewCO.get() && respondsToCallback)
NewCO->push_back(*I);
}
// If we got through all the checkers, and we built a list of those that
- // care about Assumes, save it.
+ // care about assumptions, save it.
if (NewCO.get())
CO_Ref = NewCO.take();
}
@@ -1450,7 +1451,7 @@ void GRExprEngine::ProcessBranch(const Stmt* Condition, const Stmt* Term,
// Process the true branch.
if (builder.isFeasible(true)) {
- if (const GRState *state = PrevState->Assume(V, true))
+ if (const GRState *state = PrevState->assume(V, true))
builder.generateNode(MarkBranch(state, Term, true), true);
else
builder.markInfeasible(true);
@@ -1458,7 +1459,7 @@ void GRExprEngine::ProcessBranch(const Stmt* Condition, const Stmt* Term,
// Process the false branch.
if (builder.isFeasible(false)) {
- if (const GRState *state = PrevState->Assume(V, false))
+ if (const GRState *state = PrevState->assume(V, false))
builder.generateNode(MarkBranch(state, Term, false), false);
else
builder.markInfeasible(false);
@@ -1601,7 +1602,7 @@ void GRExprEngine::ProcessSwitch(GRSwitchNodeBuilder& builder) {
CondV, CaseVal);
// Now "assume" that the case matches.
- if (const GRState* stateNew = state->Assume(Res, true)) {
+ if (const GRState* stateNew = state->assume(Res, true)) {
builder.generateCaseStmtNode(I, stateNew);
// If CondV evaluates to a constant, then we know that this
@@ -1614,7 +1615,7 @@ void GRExprEngine::ProcessSwitch(GRSwitchNodeBuilder& builder) {
// Now "assume" that the case doesn't match. Add this state
// to the default state (if it is feasible).
if (DefaultSt) {
- if (const GRState *stateNew = DefaultSt->Assume(Res, false)) {
+ if (const GRState *stateNew = DefaultSt->assume(Res, false)) {
defaultIsFeasible = true;
DefaultSt = stateNew;
}
@@ -1731,11 +1732,11 @@ void GRExprEngine::VisitLogicalExpr(const BinaryOperator* B, ExplodedNode* Pred,
// value later when necessary. We don't have the machinery in place for
// this right now, and since most logical expressions are used for branches,
// the payoff is not likely to be large. Instead, we do eager evaluation.
- if (const GRState *newState = state->Assume(XD, true))
+ if (const GRState *newState = state->assume(XD, true))
MakeNode(Dst, B, Pred,
newState->BindExpr(B, ValMgr.makeIntVal(1U, B->getType())));
- if (const GRState *newState = state->Assume(XD, false))
+ if (const GRState *newState = state->assume(XD, false))
MakeNode(Dst, B, Pred,
newState->BindExpr(B, ValMgr.makeIntVal(0U, B->getType())));
}
@@ -2263,7 +2264,7 @@ void GRExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
SVal V = state->getSVal(Ex);
if (nonloc::SymExprVal *SEV = dyn_cast<nonloc::SymExprVal>(&V)) {
// First assume that the condition is true.
- if (const GRState *stateTrue = state->Assume(*SEV, true)) {
+ if (const GRState *stateTrue = state->assume(*SEV, true)) {
stateTrue = stateTrue->BindExpr(Ex,
ValMgr.makeIntVal(1U, Ex->getType()));
Dst.Add(Builder->generateNode(PostStmtCustom(Ex,
@@ -2272,7 +2273,7 @@ void GRExprEngine::evalEagerlyAssume(ExplodedNodeSet &Dst, ExplodedNodeSet &Src,
}
// Next, assume that the condition is false.
- if (const GRState *stateFalse = state->Assume(*SEV, false)) {
+ if (const GRState *stateFalse = state->assume(*SEV, false)) {
stateFalse = stateFalse->BindExpr(Ex,
ValMgr.makeIntVal(0U, Ex->getType()));
Dst.Add(Builder->generateNode(PostStmtCustom(Ex, &EagerlyAssumeTag,
@@ -2509,7 +2510,7 @@ void GRExprEngine::VisitObjCMessageExpr(const ObjCMessageExpr* ME,
cast<DefinedOrUnknownSVal>(state->getSVal(Receiver));
const GRState *notNilState, *nilState;
- llvm::tie(notNilState, nilState) = state->Assume(receiverVal);
+ llvm::tie(notNilState, nilState) = state->assume(receiverVal);
// There are three cases: can be nil or non-nil, must be nil, must be
// non-nil. We handle must be nil, and merge the rest two into non-nil.
@@ -3270,14 +3271,14 @@ void GRExprEngine::VisitUnaryOperator(const UnaryOperator* U,
DefinedOrUnknownSVal Constraint =
svalBuilder.evalEQ(state, V2, ValMgr.makeZeroVal(U->getType()));
- if (!state->Assume(Constraint, true)) {
+ if (!state->assume(Constraint, true)) {
// It isn't feasible for the original value to be null.
// Propagate this constraint.
Constraint = svalBuilder.evalEQ(state, SymVal,
ValMgr.makeZeroVal(U->getType()));
- state = state->Assume(Constraint, false);
+ state = state->assume(Constraint, false);
assert(state);
}
}
diff --git a/lib/Checker/GRState.cpp b/lib/Checker/GRState.cpp
index 0170e3c2e3..0a2b9a388f 100644
--- a/lib/Checker/GRState.cpp
+++ b/lib/Checker/GRState.cpp
@@ -230,7 +230,7 @@ const GRState *GRState::bindExprAndLocation(const Stmt *S, SVal location,
return getStateManager().getPersistentState(NewSt);
}
-const GRState *GRState::AssumeInBound(DefinedOrUnknownSVal Idx,
+const GRState *GRState::assumeInBound(DefinedOrUnknownSVal Idx,
DefinedOrUnknownSVal UpperBound,
bool Assumption) const {
if (Idx.isUnknown() || UpperBound.isUnknown())
@@ -271,7 +271,7 @@ const GRState *GRState::AssumeInBound(DefinedOrUnknownSVal Idx,
// Finally, let the constraint manager take care of it.
ConstraintManager &CM = SM.getConstraintManager();
- return CM.Assume(this, cast<DefinedSVal>(inBound), Assumption);
+ return CM.assume(this, cast<DefinedSVal>(inBound), Assumption);
}
const GRState* GRStateManager::getInitialState(const LocationContext *InitLoc) {
diff --git a/lib/Checker/MallocChecker.cpp b/lib/Checker/MallocChecker.cpp
index d6210502f2..72f6f815ef 100644
--- a/lib/Checker/MallocChecker.cpp
+++ b/lib/Checker/MallocChecker.cpp
@@ -244,7 +244,7 @@ const GRState *MallocChecker::MallocMemAux(CheckerContext &C,
SValBuilder &svalBuilder = ValMgr.getSValBuilder();
DefinedOrUnknownSVal ExtentMatchesSize =
svalBuilder.evalEQ(state, Extent, DefinedSize);
- state = state->Assume(ExtentMatchesSize, true);
+ state = state->assume(ExtentMatchesSize, true);
SymbolRef Sym = RetVal.getAsLocSymbol();
assert(Sym);
@@ -288,7 +288,7 @@ const GRState *MallocChecker::FreeMemAux(CheckerContext &C, const CallExpr *CE,
// FIXME: Technically using 'Assume' here can result in a path
// bifurcation. In such cases we need to return two states, not just one.
const GRState *notNullState, *nullState;
- llvm::tie(notNullState, nullState) = state->Assume(location);
+ llvm::tie(notNullState, nullState) = state->assume(location);
// The explicit NULL case, no operation is performed.
if (nullState && !notNullState)
@@ -509,7 +509,7 @@ void MallocChecker::ReallocMem(CheckerContext &C, const CallExpr *CE) {
DefinedOrUnknownSVal PtrEQ = svalBuilder.evalEQ(state, Arg0Val, ValMgr.makeNull());
// If the ptr is NULL, the call is equivalent to malloc(size).
- if (const GRState *stateEqual = state->Assume(PtrEQ, true)) {
+ if (const GRState *stateEqual = state->assume(PtrEQ, true)) {
// Hack: set the NULL symbolic region to released to suppress false warning.
// In the future we should add more states for allocated regions, e.g.,
// CheckedNull, CheckedNonNull.
@@ -523,20 +523,20 @@ void MallocChecker::ReallocMem(CheckerContext &C, const CallExpr *CE) {
C.addTransition(stateMalloc);
}
- if (const GRState *stateNotEqual = state->Assume(PtrEQ, false)) {
+ if (const GRState *stateNotEqual = state->assume(PtrEQ, false)) {
const Expr *Arg1 = CE->getArg(1);
DefinedOrUnknownSVal Arg1Val =
cast<DefinedOrUnknownSVal>(stateNotEqual->getSVal(Arg1));
DefinedOrUnknownSVal SizeZero = svalBuilder.evalEQ(stateNotEqual, Arg1Val,
ValMgr.makeIntValWithPtrWidth(0, false));
- if (const GRState *stateSizeZero = stateNotEqual->Assume(SizeZero, true)) {