]> granicus.if.org Git - clang/commitdiff
Rename all 'AssumeXXX' methods in libChecker
authorTed Kremenek <kremenek@apple.com>
Wed, 1 Dec 2010 22:16:56 +0000 (22:16 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 1 Dec 2010 22:16:56 +0000 (22:16 +0000)
to 'assumeXXX'.

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

25 files changed:
include/clang/Checker/PathSensitive/ConstraintManager.h
include/clang/Checker/PathSensitive/GRState.h
lib/Checker/ArrayBoundChecker.cpp
lib/Checker/AttrNonNullChecker.cpp
lib/Checker/BasicConstraintManager.cpp
lib/Checker/BasicObjCFoundationChecks.cpp
lib/Checker/BugReporterVisitors.cpp
lib/Checker/BuiltinFunctionChecker.cpp
lib/Checker/CFRefCount.cpp
lib/Checker/CStringChecker.cpp
lib/Checker/DereferenceChecker.cpp
lib/Checker/DivZeroChecker.cpp
lib/Checker/GRExprEngine.cpp
lib/Checker/GRState.cpp
lib/Checker/MallocChecker.cpp
lib/Checker/OSAtomicChecker.cpp
lib/Checker/ObjCAtSyncChecker.cpp
lib/Checker/PthreadLockChecker.cpp
lib/Checker/RangeConstraintManager.cpp
lib/Checker/ReturnPointerRangeChecker.cpp
lib/Checker/SimpleConstraintManager.cpp
lib/Checker/SimpleConstraintManager.h
lib/Checker/StreamChecker.cpp
lib/Checker/UnixAPIChecker.cpp
lib/Checker/VLASizeChecker.cpp

index 97535f55bfb9fe15aee36a634be65dda4ae4fac4..fe37291279cad410711c4cf00c33fb944720b193 100644 (file)
@@ -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,
index 8127649d778a0df35c0872eda65d8093888e9d4c..c59842f88d9dd0e291fe74d15a850b9ebe61fb07 100644 (file)
@@ -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));
 }
 
index dccb9a295277cb13e53efa813ec5eda00a8270dd..fe532a2b1db3264ac0e90df73c5fc5e4f1baeeec 100644 (file)
@@ -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)
index 54b7b72d43b4a423722d421c91eb48bc12ee376a..28f79c4a1544f09ca5cfd112fb045e38ffd9add2 100644 (file)
@@ -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
index b8da6b71af1b5cc54e304cda85f7a13eaa76caa9..862b59babdd52a9ed29811edd2353c6ed1add337 100644 (file)
@@ -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).
index 5db957fcfb91d82ff0abee36e05dde36c0e61900..1e48b1ad449f33485fc69aa21c418cb785a42ea0 100644 (file)
@@ -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);
index 91cf349107cadbc959c4154e651298bfac2f9f05..d466abe0684a204e099041d8bd1cf6cebbf9eac8 100644 (file)
@@ -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;
 
index a43a28449b8cd4a6fae7d8f7b2a01f4d988295f0..13875732ef0aac15bdbd51574471c4506081eaf7 100644 (file)
@@ -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;
index a1eff948c710053ed51dbd3f1680bb72a84e3739..0be30b61dba01c124c86088e4f31b143a03efa87 100644 (file)
@@ -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
index 2454668f5dc0fb7509e60b41e75f94d4fdd9c485..a177710c172f1536ffe0e32d8ac2d51deb13a6d5 100644 (file)
@@ -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.
index bb40a84cb006b00fee29b77b801b3887379d439d..747fcbe311f888f6c24974f746b8f06e37c4748c 100644 (file)
@@ -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) {
index 32e2a1782d10cd4acf899586a5f046026d563d50..d795800d6f58cf6d550fb7e1ac9096b4d7120f9c 100644 (file)
@@ -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)) {
index 1afad765584262012b97c34e63bdde57004f2c3e..a552447b3009137aa971edfe403abdedaa1b5e92 100644 (file)
@@ -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);
           }
         }
index 0170e3c2e3b053cd2cebd97896c39c4103d43939..0a2b9a388f95d6813df2e51dcf086fb1eb725053 100644 (file)
@@ -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) {
index d6210502f2025b143e920ee20c95fce2cbebb88b..72f6f815efbb7abe6e57dd842b5f923787cd0f43 100644 (file)
@@ -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)) {
+    if (const GRState *stateSizeZero = stateNotEqual->assume(SizeZero, true)) {
       const GRState *stateFree = FreeMemAux(C, CE, stateSizeZero, 0, false);
       if (stateFree)
         C.addTransition(stateFree->BindExpr(CE, UndefinedVal(), true));
     }
 
-    if (const GRState *stateSizeNotZero=stateNotEqual->Assume(SizeZero,false)) {
+    if (const GRState *stateSizeNotZero=stateNotEqual->assume(SizeZero,false)) {
       const GRState *stateFree = FreeMemAux(C, CE, stateSizeNotZero, 0, false);
       if (stateFree) {
         // FIXME: We should copy the content of the original buffer.
@@ -697,7 +697,7 @@ void MallocChecker::PreVisitBind(CheckerContext &C,
     if (const RefState *RS = state->get<RegionState>(Sym)) {
       // If ptr is NULL, no operation is performed.
       const GRState *notNullState, *nullState;
-      llvm::tie(notNullState, nullState) = state->Assume(l);
+      llvm::tie(notNullState, nullState) = state->assume(l);
 
       // Generate a transition for 'nullState' to record the assumption
       // that the state was null.
index 21a5d2d9c8f279d9e1ee2ae1df270b7d904ac8ac..c536ce669c5196cc318953e02881ebf3a5070e53 100644 (file)
@@ -147,7 +147,7 @@ bool OSAtomicChecker::evalOSAtomicCompareAndSwap(CheckerContext &C,
     // Perform the comparison.
     DefinedOrUnknownSVal Cmp = svalBuilder.evalEQ(stateLoad,theValueVal,oldValueVal);
 
-    const GRState *stateEqual = stateLoad->Assume(Cmp, true);
+    const GRState *stateEqual = stateLoad->assume(Cmp, true);
 
     // Were they equal?
     if (stateEqual) {
@@ -188,7 +188,7 @@ bool OSAtomicChecker::evalOSAtomicCompareAndSwap(CheckerContext &C,
     }
 
     // Were they not equal?
-    if (const GRState *stateNotEqual = stateLoad->Assume(Cmp, false)) {
+    if (const GRState *stateNotEqual = stateLoad->assume(Cmp, false)) {
       // Check for 'void' return type if we have a bogus function prototype.
       SVal Res = UnknownVal();
       QualType T = CE->getType();
index 139cac24862e87587f4adfcec74d61ec31d3c970..62428d2faf5082198d5cd44ea254b5597d8520b7 100644 (file)
@@ -64,7 +64,7 @@ void ObjCAtSyncChecker::PreVisitObjCAtSynchronizedStmt(CheckerContext &C,
 
   // Check for null mutexes.
   const GRState *notNullState, *nullState;
-  llvm::tie(notNullState, nullState) = state->Assume(cast<DefinedSVal>(V));
+  llvm::tie(notNullState, nullState) = state->assume(cast<DefinedSVal>(V));
 
   if (nullState) {
     if (!notNullState) {
index c4bd3641382f097174a07623b742fb1572fbad1c..1080e16027da62680d719444566eb31483bdd59b 100644 (file)
@@ -106,13 +106,13 @@ void PthreadLockChecker::AcquireLock(CheckerContext &C, const CallExpr *CE,
   if (isTryLock) {
       // Bifurcate the state, and allow a mode where the lock acquisition fails.
     const GRState *lockFail;
-    llvm::tie(lockFail, lockSucc) = state->Assume(retVal);    
+    llvm::tie(lockFail, lockSucc) = state->assume(retVal);    
     assert(lockFail && lockSucc);
     C.addTransition(C.GenerateNode(CE, lockFail));
   }
   else {
       // Assume that the return value was 0.
-    lockSucc = state->Assume(retVal, false);
+    lockSucc = state->assume(retVal, false);
     assert(lockSucc);
   }
   
index 0a15c2ad04ee43ced0f409705d0860a34d76d2d8..e625ee2b903690b61530a731781502c5b32fb202 100644 (file)
@@ -208,27 +208,27 @@ public:
   RangeConstraintManager(GRSubEngine &subengine)
     : SimpleConstraintManager(subengine) {}
 
-  const GRState* AssumeSymNE(const GRState* state, SymbolRef sym,
+  const GRState *assumeSymNE(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& Int,
                              const llvm::APSInt& Adjustment);
 
-  const GRState* AssumeSymEQ(const GRState* state, SymbolRef sym,
+  const GRState *assumeSymEQ(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& Int,
                              const llvm::APSInt& Adjustment);
 
-  const GRState* AssumeSymLT(const GRState* state, SymbolRef sym,
+  const GRState *assumeSymLT(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& Int,
                              const llvm::APSInt& Adjustment);
 
-  const GRState* AssumeSymGT(const GRState* state, SymbolRef sym,
+  const GRState *assumeSymGT(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& Int,
                              const llvm::APSInt& Adjustment);
 
-  const GRState* AssumeSymGE(const GRState* state, SymbolRef sym,
+  const GRState *assumeSymGE(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& Int,
                              const llvm::APSInt& Adjustment);
 
-  const GRState* AssumeSymLE(const GRState* state, SymbolRef sym,
+  const GRState *assumeSymLE(const GRState* state, SymbolRef sym,
                              const llvm::APSInt& Int,
                              const llvm::APSInt& Adjustment);
 
@@ -293,7 +293,7 @@ RangeConstraintManager::GetRange(const GRState *state, SymbolRef sym) {
 }
 
 //===------------------------------------------------------------------------===
-// AssumeSymX methods: public interface for RangeConstraintManager.
+// assumeSymX methods: public interface for RangeConstraintManager.
 //===------------------------------------------------------------------------===/
 
 // The syntax for ranges below is mathematical, using [x, y] for closed ranges
@@ -305,7 +305,7 @@ RangeConstraintManager::GetRange(const GRState *state, SymbolRef sym) {
 // UINT_MAX, 0, 1, and 2.
 
 const GRState*
-RangeConstraintManager::AssumeSymNE(const GRState* state, SymbolRef sym,
+RangeConstraintManager::assumeSymNE(const GRState* state, SymbolRef sym,
                                     const llvm::APSInt& Int,
                                     const llvm::APSInt& Adjustment) {
   BasicValueFactory &BV = state->getBasicVals();
@@ -322,7 +322,7 @@ RangeConstraintManager::AssumeSymNE(const GRState* state, SymbolRef sym,
 }
 
 const GRState*
-RangeConstraintManager::AssumeSymEQ(const GRState* state, SymbolRef sym,
+RangeConstraintManager::assumeSymEQ(const GRState* state, SymbolRef sym,
                                     const llvm::APSInt& Int,
                                     const llvm::APSInt& Adjustment) {
   // [Int-Adjustment, Int-Adjustment]
@@ -333,7 +333,7 @@ RangeConstraintManager::AssumeSymEQ(const GRState* state, SymbolRef sym,
 }
 
 const GRState*
-RangeConstraintManager::AssumeSymLT(const GRState* state, SymbolRef sym,
+RangeConstraintManager::assumeSymLT(const GRState* state, SymbolRef sym,
                                     const llvm::APSInt& Int,
                                     const llvm::APSInt& Adjustment) {
   BasicValueFactory &BV = state->getBasicVals();
@@ -354,7 +354,7 @@ RangeConstraintManager::AssumeSymLT(const GRState* state, SymbolRef sym,
 }
 
 const GRState*
-RangeConstraintManager::AssumeSymGT(const GRState* state, SymbolRef sym,
+RangeConstraintManager::assumeSymGT(const GRState* state, SymbolRef sym,
                                     const llvm::APSInt& Int,
                                     const llvm::APSInt& Adjustment) {
   BasicValueFactory &BV = state->getBasicVals();
@@ -375,7 +375,7 @@ RangeConstraintManager::AssumeSymGT(const GRState* state, SymbolRef sym,
 }
 
 const GRState*
-RangeConstraintManager::AssumeSymGE(const GRState* state, SymbolRef sym,
+RangeConstraintManager::assumeSymGE(const GRState* state, SymbolRef sym,
                                     const llvm::APSInt& Int,
                                     const llvm::APSInt& Adjustment) {
   BasicValueFactory &BV = state->getBasicVals();
@@ -397,7 +397,7 @@ RangeConstraintManager::AssumeSymGE(const GRState* state, SymbolRef sym,
 }
 
 const GRState*
-RangeConstraintManager::AssumeSymLE(const GRState* state, SymbolRef sym,
+RangeConstraintManager::assumeSymLE(const GRState* state, SymbolRef sym,
                                     const llvm::APSInt& Int,
                                     const llvm::APSInt& Adjustment) {
   BasicValueFactory &BV = state->getBasicVals();
index f743eeb6eb2defd5d737dd6652a36d62c0085ff7..79bff08dc35610a916d79c5dfa3428db8bbc9994 100644 (file)
@@ -65,8 +65,8 @@ void ReturnPointerRangeChecker::PreVisitReturnStmt(CheckerContext &C,
     = 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);
 
index 3fdf7902c206534679df6c90a2f8aab8571427b6..c23c749aa3e42058f865c4b284e7476ed7847497 100644 (file)
@@ -55,22 +55,22 @@ bool SimpleConstraintManager::canReasonAbout(SVal X) const {
   return true;
 }
 
-const GRState *SimpleConstraintManager::Assume(const GRState *state,
+const GRState *SimpleConstraintManager::assume(const GRState *state,
                                                DefinedSVal Cond,
                                                bool Assumption) {
   if (isa<NonLoc>(Cond))
-    return Assume(state, cast<NonLoc>(Cond), Assumption);
+    return assume(state, cast<NonLoc>(Cond), Assumption);
   else
-    return Assume(state, cast<Loc>(Cond), Assumption);
+    return assume(state, cast<Loc>(Cond), Assumption);
 }
 
-const GRState *SimpleConstraintManager::Assume(const GRState *state, Loc cond,
+const GRState *SimpleConstraintManager::assume(const GRState *state, Loc cond,
                                                bool assumption) {
-  state = AssumeAux(state, cond, assumption);
+  state = assumeAux(state, cond, assumption);
   return SU.ProcessAssume(state, cond, assumption);
 }
 
-const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
+const GRState *SimpleConstraintManager::assumeAux(const GRState *state,
                                                   Loc Cond, bool Assumption) {
 
   BasicValueFactory &BasicVals = state->getBasicVals();
@@ -91,9 +91,9 @@ const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
       if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(SubR)) {
         const llvm::APSInt &zero = BasicVals.getZeroWithPtrWidth();
         if (Assumption)
-          return AssumeSymNE(state, SymR->getSymbol(), zero, zero);
+          return assumeSymNE(state, SymR->getSymbol(), zero, zero);
         else
-          return AssumeSymEQ(state, SymR->getSymbol(), zero, zero);
+          return assumeSymEQ(state, SymR->getSymbol(), zero, zero);
       }
       SubR = dyn_cast<SubRegion>(SubR->getSuperRegion());
     }
@@ -112,10 +112,10 @@ const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
   } // end switch
 }
 
-const GRState *SimpleConstraintManager::Assume(const GRState *state,
+const GRState *SimpleConstraintManager::assume(const GRState *state,
                                                NonLoc cond,
                                                bool assumption) {
-  state = AssumeAux(state, cond, assumption);
+  state = assumeAux(state, cond, assumption);
   return SU.ProcessAssume(state, cond, assumption);
 }
 
@@ -134,7 +134,7 @@ static BinaryOperator::Opcode NegateComparison(BinaryOperator::Opcode op) {
   }
 }
 
-const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
+const GRState *SimpleConstraintManager::assumeAux(const GRState *state,
                                                   NonLoc Cond,
                                                   bool Assumption) {
 
@@ -159,9 +159,9 @@ const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
     QualType T =  SymMgr.getType(sym);
     const llvm::APSInt &zero = BasicVals.getValue(0, T);
     if (Assumption)
-      return AssumeSymNE(state, sym, zero, zero);
+      return assumeSymNE(state, sym, zero, zero);
     else
-      return AssumeSymEQ(state, sym, zero, zero);
+      return assumeSymEQ(state, sym, zero, zero);
   }
 
   case nonloc::SymExprValKind: {
@@ -179,14 +179,14 @@ const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
       QualType T = SymMgr.getType(SE);
       const llvm::APSInt &zero = BasicVals.getValue(0, T);
       op = (Assumption ? BO_NE : BO_EQ);
-      return AssumeSymRel(state, SE, op, zero);
+      return assumeSymRel(state, SE, op, zero);
     }
 
     // From here on out, op is the real comparison we'll be testing.
     if (!Assumption)
       op = NegateComparison(op);
   
-    return AssumeSymRel(state, SE->getLHS(), op, SE->getRHS());
+    return assumeSymRel(state, SE->getLHS(), op, SE->getRHS());
   }
 
   case nonloc::ConcreteIntKind: {
@@ -196,12 +196,12 @@ const GRState *SimpleConstraintManager::AssumeAux(const GRState *state,
   }
 
   case nonloc::LocAsIntegerKind:
-    return AssumeAux(state, cast<nonloc::LocAsInteger>(Cond).getLoc(),
+    return assumeAux(state, cast<nonloc::LocAsInteger>(Cond).getLoc(),
                      Assumption);
   } // end switch
 }
 
-const GRState *SimpleConstraintManager::AssumeSymRel(const GRState *state,
+const GRState *SimpleConstraintManager::assumeSymRel(const GRState *state,
                                                      const SymExpr *LHS,
                                                      BinaryOperator::Opcode op,
                                                      const llvm::APSInt& Int) {
@@ -273,26 +273,26 @@ const GRState *SimpleConstraintManager::AssumeSymRel(const GRState *state,
 
   switch (op) {
   default:
-    // No logic yet for other operators.  Assume the constraint is feasible.
+    // No logic yet for other operators.  assume the constraint is feasible.
     return state;
 
   case BO_EQ:
-    return AssumeSymEQ(state, Sym, ConvertedInt, Adjustment);
+    return assumeSymEQ(state, Sym, ConvertedInt, Adjustment);
 
   case BO_NE:
-    return AssumeSymNE(state, Sym, ConvertedInt, Adjustment);
+    return assumeSymNE(state, Sym, ConvertedInt, Adjustment);
 
   case BO_GT:
-    return AssumeSymGT(state, Sym, ConvertedInt, Adjustment);
+    return assumeSymGT(state, Sym, ConvertedInt, Adjustment);
 
   case BO_GE:
-    return AssumeSymGE(state, Sym, ConvertedInt, Adjustment);
+    return assumeSymGE(state, Sym, ConvertedInt, Adjustment);
 
   case BO_LT:
-    return AssumeSymLT(state, Sym, ConvertedInt, Adjustment);
+    return assumeSymLT(state, Sym, ConvertedInt, Adjustment);
 
   case BO_LE:
-    return AssumeSymLE(state, Sym, ConvertedInt, Adjustment);
+    return assumeSymLE(state, Sym, ConvertedInt, Adjustment);
   } // end switch
 }
 
index 96811b3e36e68fcf6208d4558c4653fa9ee5a718..9d97512eb7706aebe88d4f3d8590277e3e53dd50 100644 (file)
@@ -31,14 +31,14 @@ public:
 
   bool canReasonAbout(SVal X) const;
 
-  const GRState *Assume(const GRState *state, DefinedSVal Cond,
+  const GRState *assume(const GRState *state, DefinedSVal Cond,
                         bool Assumption);
 
-  const GRState *Assume(const GRState *state, Loc Cond, bool Assumption);
+  const GRState *assume(const GRState *state, Loc Cond, bool Assumption);
 
-  const GRState *Assume(const GRState *state, NonLoc Cond, bool Assumption);
+  const GRState *assume(const GRState *state, NonLoc Cond, bool Assumption);
 
-  const GRState *AssumeSymRel(const GRState *state,
+  const GRState *assumeSymRel(const GRState *state,
                               const SymExpr *LHS,
                               BinaryOperator::Opcode op,
                               const llvm::APSInt& Int);
@@ -51,27 +51,27 @@ protected:
 
   // Each of these is of the form "$sym+Adj <> V", where "<>" is the comparison
   // operation for the method being invoked.
-  virtual const GRState *AssumeSymNE(const GRState *state, SymbolRef sym,
+  virtual const GRState *assumeSymNE(const GRState *state, SymbolRef sym,
                                      const llvm::APSInt& V,
                                      const llvm::APSInt& Adjustment) = 0;
 
-  virtual const GRState *AssumeSymEQ(const GRState *state, SymbolRef sym,
+  virtual const GRState *assumeSymEQ(const GRState *state, SymbolRef sym,
                                      const llvm::APSInt& V,
                                      const llvm::APSInt& Adjustment) = 0;
 
-  virtual const GRState *AssumeSymLT(const GRState *state, SymbolRef sym,
+  virtual const GRState *assumeSymLT(const GRState *state, SymbolRef sym,
                                      const llvm::APSInt& V,
                                      const llvm::APSInt& Adjustment) = 0;
 
-  virtual const GRState *AssumeSymGT(const GRState *state, SymbolRef sym,
+  virtual const GRState *assumeSymGT(const GRState *state, SymbolRef sym,
                                      const llvm::APSInt& V,
                                      const llvm::APSInt& Adjustment) = 0;
 
-  virtual const GRState *AssumeSymLE(const GRState *state, SymbolRef sym,
+  virtual const GRState *assumeSymLE(const GRState *state, SymbolRef sym,
                                      const llvm::APSInt& V,
                                      const llvm::APSInt& Adjustment) = 0;
 
-  virtual const GRState *AssumeSymGE(const GRState *state, SymbolRef sym,
+  virtual const GRState *assumeSymGE(const GRState *state, SymbolRef sym,
                                      const llvm::APSInt& V,
                                      const llvm::APSInt& Adjustment) = 0;
 
@@ -79,9 +79,9 @@ protected:
   // Internal implementation.
   //===------------------------------------------------------------------===//
 
-  const GRState *AssumeAux(const GRState *state, Loc Cond,bool Assumption);
+  const GRState *assumeAux(const GRState *state, Loc Cond,bool Assumption);
 
-  const GRState *AssumeAux(const GRState *state, NonLoc Cond, bool Assumption);
+  const GRState *assumeAux(const GRState *state, NonLoc Cond, bool Assumption);
 };
 
 }  // end clang namespace
index 145ccc9bde1d35f8c31eee35e5f7d0923d06bed7..a209c505ebb921e1c8a5622a304216e910072067 100644 (file)
@@ -233,7 +233,7 @@ void StreamChecker::OpenFileAux(CheckerContext &C, const CallExpr *CE) {
   // Bifurcate the state into two: one with a valid FILE* pointer, the other
   // with a NULL.
   const GRState *stateNotNull, *stateNull;
-  llvm::tie(stateNotNull, stateNull) = CM.AssumeDual(state, RetVal);
+  llvm::tie(stateNotNull, stateNull) = CM.assumeDual(state, RetVal);
   
   if (SymbolRef Sym = RetVal.getAsSymbol()) {
     // if RetVal is not NULL, set the symbol's state to Opened.
@@ -347,7 +347,7 @@ const GRState *StreamChecker::CheckNullStream(SVal SV, const GRState *state,
 
   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 (!stateNotNull && stateNull) {
     if (ExplodedNode *N = C.GenerateSink(stateNull)) {
index 9612880a1e9fcd3060bbc2d82a69e64005892ae9..833217c90ad70c8d9c5d022bf9906aa437108d85 100644 (file)
@@ -110,7 +110,7 @@ static void CheckOpen(CheckerContext &C, UnixAPIChecker &UC,
 
   // Check if maskedFlags is non-zero.
   const GRState *trueState, *falseState;
-  llvm::tie(trueState, falseState) = state->Assume(maskedFlags);
+  llvm::tie(trueState, falseState) = state->assume(maskedFlags);
 
   // Only emit an error if the value of 'maskedFlags' is properly
   // constrained;
@@ -195,7 +195,7 @@ static void CheckMallocZero(CheckerContext &C, UnixAPIChecker &UC,
     return;
   
   const GRState *trueState, *falseState;
-  llvm::tie(trueState, falseState) = state->Assume(cast<DefinedSVal>(argVal));
+  llvm::tie(trueState, falseState) = state->assume(cast<DefinedSVal>(argVal));
   
   // Is the value perfectly constrained to zero?
   if (falseState && !trueState) {
index 520101e399c784c9e4ba68645d7a851fd082a983..2b79797f7e1f4109069470c4779711a92a7711a1 100644 (file)
@@ -83,7 +83,7 @@ void VLASizeChecker::PreVisitDeclStmt(CheckerContext &C, const DeclStmt *DS) {
   DefinedSVal sizeD = cast<DefinedSVal>(sizeV);
 
   const GRState *stateNotZero, *stateZero;
-  llvm::tie(stateNotZero, stateZero) = state->Assume(sizeD);
+  llvm::tie(stateNotZero, stateZero) = state->assume(sizeD);
 
   if (stateZero && !stateNotZero) {
     ExplodedNode* N = C.GenerateSink(stateZero);
@@ -120,12 +120,12 @@ void VLASizeChecker::PreVisitDeclStmt(CheckerContext &C, const DeclStmt *DS) {
   SVal ArraySizeVal = SV.evalBinOpNN(state, BO_Mul, ArrayLength,
                                      cast<NonLoc>(EleSizeVal), SizeTy);
 
-  // Finally, Assume that the array's extent matches the given size.
+  // Finally, assume that the array's extent matches the given size.
   const LocationContext *LC = C.getPredecessor()->getLocationContext();
   DefinedOrUnknownSVal Extent = state->getRegion(VD, LC)->getExtent(ValMgr);
   DefinedOrUnknownSVal ArraySize = cast<DefinedOrUnknownSVal>(ArraySizeVal);
   DefinedOrUnknownSVal SizeIsKnown = SV.evalEQ(state, Extent, ArraySize);
-  state = state->Assume(SizeIsKnown, true);
+  state = state->assume(SizeIsKnown, true);
 
   // Assume should not fail at this point.
   assert(state);