From: Ted Kremenek Date: Fri, 11 Feb 2011 19:48:15 +0000 (+0000) Subject: Rename 'InvalidateRegions()' to 'invalidateRegions()'. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2534528c22260211a073e192c38d0db84c70c327;p=clang Rename 'InvalidateRegions()' to 'invalidateRegions()'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125395 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h b/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h index 4c5b94f307..f1f814a6cb 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/GRState.h @@ -226,19 +226,19 @@ public: const GRState *unbindLoc(Loc LV) const; - /// InvalidateRegion - Returns the state with bindings for the given region - /// cleared from the store. See InvalidateRegions. - const GRState *InvalidateRegion(const MemRegion *R, + /// invalidateRegion - Returns the state with bindings for the given region + /// cleared from the store. See invalidateRegions. + const GRState *invalidateRegion(const MemRegion *R, const Expr *E, unsigned BlockCount, StoreManager::InvalidatedSymbols *IS = NULL) const { - return InvalidateRegions(&R, &R+1, E, BlockCount, IS, false); + return invalidateRegions(&R, &R+1, E, BlockCount, IS, false); } - /// InvalidateRegions - Returns the state with bindings for the given regions + /// invalidateRegions - Returns the state with bindings for the given regions /// cleared from the store. The regions are provided as a continuous array /// from Begin to End. Optionally invalidates global regions as well. - const GRState *InvalidateRegions(const MemRegion * const *Begin, + const GRState *invalidateRegions(const MemRegion * const *Begin, const MemRegion * const *End, const Expr *E, unsigned BlockCount, StoreManager::InvalidatedSymbols *IS, diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h b/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h index 2cacd375a8..24341d1f2e 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h @@ -148,10 +148,10 @@ public: const ElementRegion *GetElementZeroRegion(const MemRegion *R, QualType T); - /// CastRegion - Used by ExprEngine::VisitCast to handle casts from + /// castRegion - Used by ExprEngine::VisitCast to handle casts from /// a MemRegion* to a specific location type. 'R' is the region being /// casted and 'CastToTy' the result type of the cast. - const MemRegion *CastRegion(const MemRegion *region, QualType CastToTy); + const MemRegion *castRegion(const MemRegion *region, QualType CastToTy); virtual Store removeDeadBindings(Store store, const StackFrameContext *LCtx, SymbolReaper& SymReaper, @@ -164,7 +164,7 @@ public: typedef llvm::DenseSet InvalidatedSymbols; typedef llvm::SmallVector InvalidatedRegions; - /// InvalidateRegions - Clears out the specified regions from the store, + /// invalidateRegions - Clears out the specified regions from the store, /// marking their values as unknown. Depending on the store, this may also /// invalidate additional regions that may have changed based on accessing /// the given regions. Optionally, invalidates non-static globals as well. @@ -183,7 +183,7 @@ public: /// invalidated. This should include any regions explicitly invalidated /// even if they do not currently have bindings. Pass \c NULL if this /// information will not be used. - virtual Store InvalidateRegions(Store store, + virtual Store invalidateRegions(Store store, const MemRegion * const *Begin, const MemRegion * const *End, const Expr *E, unsigned Count, diff --git a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp index df15edc3d1..51e6650908 100644 --- a/lib/StaticAnalyzer/Checkers/CStringChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/CStringChecker.cpp @@ -593,7 +593,7 @@ const GRState *CStringChecker::InvalidateBuffer(CheckerContext &C, // Invalidate this region. unsigned Count = C.getNodeBuilder().getCurrentBlockCount(); - return state->InvalidateRegion(R, E, Count, NULL); + return state->invalidateRegion(R, E, Count, NULL); } // If we have a non-region value by chance, just remove the binding. diff --git a/lib/StaticAnalyzer/Core/BasicStore.cpp b/lib/StaticAnalyzer/Core/BasicStore.cpp index e082921b0e..105b505242 100644 --- a/lib/StaticAnalyzer/Core/BasicStore.cpp +++ b/lib/StaticAnalyzer/Core/BasicStore.cpp @@ -48,10 +48,10 @@ public: SVal Retrieve(Store store, Loc loc, QualType T = QualType()); - Store InvalidateRegion(Store store, const MemRegion *R, const Expr *E, + Store invalidateRegion(Store store, const MemRegion *R, const Expr *E, unsigned Count, InvalidatedSymbols *IS); - Store InvalidateRegions(Store store, const MemRegion * const *Begin, + Store invalidateRegions(Store store, const MemRegion * const *Begin, const MemRegion * const *End, const Expr *E, unsigned Count, InvalidatedSymbols *IS, bool invalidateGlobals, InvalidatedRegions *Regions); @@ -144,7 +144,7 @@ SVal BasicStoreManager::LazyRetrieve(Store store, const TypedRegion *R) { // Globals and parameters start with symbolic values. // Local variables initially are undefined. - // Non-static globals may have had their values reset by InvalidateRegions. + // Non-static globals may have had their values reset by invalidateRegions. const MemSpaceRegion *MS = VR->getMemorySpace(); if (isa(MS)) { BindingsTy B = GetBindings(store); @@ -523,7 +523,7 @@ StoreManager::BindingsHandler::~BindingsHandler() {} //===----------------------------------------------------------------------===// -Store BasicStoreManager::InvalidateRegions(Store store, +Store BasicStoreManager::invalidateRegions(Store store, const MemRegion * const *I, const MemRegion * const *End, const Expr *E, unsigned Count, @@ -535,7 +535,7 @@ Store BasicStoreManager::InvalidateRegions(Store store, for (BindingsTy::iterator I=B.begin(), End=B.end(); I != End; ++I) { const MemRegion *R = I.getKey(); if (isa(R->getMemorySpace())) - store = InvalidateRegion(store, R, E, Count, IS); + store = invalidateRegion(store, R, E, Count, IS); } } @@ -546,7 +546,7 @@ Store BasicStoreManager::InvalidateRegions(Store store, if (isa(R->getMemorySpace())) continue; } - store = InvalidateRegion(store, *I, E, Count, IS); + store = invalidateRegion(store, *I, E, Count, IS); if (Regions) Regions->push_back(R); } @@ -570,7 +570,7 @@ Store BasicStoreManager::InvalidateRegions(Store store, } -Store BasicStoreManager::InvalidateRegion(Store store, +Store BasicStoreManager::invalidateRegion(Store store, const MemRegion *R, const Expr *E, unsigned Count, diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp index fb43b345ae..09e69239d6 100644 --- a/lib/StaticAnalyzer/Core/CFRefCount.cpp +++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp @@ -2601,7 +2601,7 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst, // NOTE: Even if RegionsToInvalidate is empty, we must still invalidate // global variables. - state = state->InvalidateRegions(RegionsToInvalidate.data(), + state = state->invalidateRegions(RegionsToInvalidate.data(), RegionsToInvalidate.data() + RegionsToInvalidate.size(), Ex, Count, &IS, diff --git a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp index ece4f920d3..56dfe8cb04 100644 --- a/lib/StaticAnalyzer/Core/CXXExprEngine.cpp +++ b/lib/StaticAnalyzer/Core/CXXExprEngine.cpp @@ -280,7 +280,7 @@ void ExprEngine::VisitCXXNewExpr(const CXXNewExpr *CNE, ExplodedNode *Pred, const GRState *state = GetState(*I); if (ObjTy->isRecordType()) { - state = state->InvalidateRegion(EleReg, CNE, Count); + state = state->invalidateRegion(EleReg, CNE, Count); } else { if (CNE->hasInitializer()) { SVal V = state->getSVal(*CNE->constructor_arg_begin()); diff --git a/lib/StaticAnalyzer/Core/FlatStore.cpp b/lib/StaticAnalyzer/Core/FlatStore.cpp index d8bdc55e74..c3da72af5a 100644 --- a/lib/StaticAnalyzer/Core/FlatStore.cpp +++ b/lib/StaticAnalyzer/Core/FlatStore.cpp @@ -57,7 +57,7 @@ public: typedef llvm::DenseSet InvalidatedSymbols; - Store InvalidateRegions(Store store, const MemRegion * const *I, + Store invalidateRegions(Store store, const MemRegion * const *I, const MemRegion * const *E, const Expr *Ex, unsigned Count, InvalidatedSymbols *IS, bool invalidateGlobals, InvalidatedRegions *Regions); @@ -157,7 +157,7 @@ Store FlatStoreManager::BindDeclWithNoInit(Store store, const VarRegion *VR) { return store; } -Store FlatStoreManager::InvalidateRegions(Store store, +Store FlatStoreManager::invalidateRegions(Store store, const MemRegion * const *I, const MemRegion * const *E, const Expr *Ex, unsigned Count, diff --git a/lib/StaticAnalyzer/Core/GRState.cpp b/lib/StaticAnalyzer/Core/GRState.cpp index 0278a0d385..80f2ae082b 100644 --- a/lib/StaticAnalyzer/Core/GRState.cpp +++ b/lib/StaticAnalyzer/Core/GRState.cpp @@ -110,7 +110,7 @@ const GRState *GRState::bindDefault(SVal loc, SVal V) const { new_state; } -const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin, +const GRState *GRState::invalidateRegions(const MemRegion * const *Begin, const MemRegion * const *End, const Expr *E, unsigned Count, StoreManager::InvalidatedSymbols *IS, @@ -121,7 +121,7 @@ const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin, if (Eng && Eng->wantsRegionChangeUpdate(this)) { StoreManager::InvalidatedRegions Regions; - Store new_store = Mgr.StoreMgr->InvalidateRegions(St, Begin, End, + Store new_store = Mgr.StoreMgr->invalidateRegions(St, Begin, End, E, Count, IS, invalidateGlobals, &Regions); @@ -132,7 +132,7 @@ const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin, &Regions.back()+1); } - Store new_store = Mgr.StoreMgr->InvalidateRegions(St, Begin, End, + Store new_store = Mgr.StoreMgr->invalidateRegions(St, Begin, End, E, Count, IS, invalidateGlobals, NULL); @@ -140,7 +140,7 @@ const GRState *GRState::InvalidateRegions(const MemRegion * const *Begin, } const GRState *GRState::unbindLoc(Loc LV) const { - assert(!isa(LV) && "Use InvalidateRegion instead."); + assert(!isa(LV) && "Use invalidateRegion instead."); Store OldStore = getStore(); Store NewStore = getStateManager().StoreMgr->Remove(OldStore, LV); diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp index ab93ccb41d..c5d21e8b22 100644 --- a/lib/StaticAnalyzer/Core/RegionStore.cpp +++ b/lib/StaticAnalyzer/Core/RegionStore.cpp @@ -228,8 +228,6 @@ public: /// For DerivedToBase casts, create a CXXBaseObjectRegion and return it. virtual SVal evalDerivedToBase(SVal derived, QualType basePtrType); - SVal evalBinOp(BinaryOperator::Opcode Op,Loc L, NonLoc R, QualType resultTy); - Store getInitialStore(const LocationContext *InitLoc) { return RBFactory.getEmptyMap().getRoot(); } @@ -238,7 +236,7 @@ public: // Binding values to regions. //===-------------------------------------------------------------------===// - Store InvalidateRegions(Store store, + Store invalidateRegions(Store store, const MemRegion * const *Begin, const MemRegion * const *End, const Expr *E, unsigned Count, @@ -570,21 +568,21 @@ void RegionStoreManager::RemoveSubRegionBindings(RegionBindings &B, } namespace { -class InvalidateRegionsWorker : public ClusterAnalysis +class invalidateRegionsWorker : public ClusterAnalysis { const Expr *Ex; unsigned Count; StoreManager::InvalidatedSymbols *IS; StoreManager::InvalidatedRegions *Regions; public: - InvalidateRegionsWorker(RegionStoreManager &rm, + invalidateRegionsWorker(RegionStoreManager &rm, GRStateManager &stateMgr, RegionBindings b, const Expr *ex, unsigned count, StoreManager::InvalidatedSymbols *is, StoreManager::InvalidatedRegions *r, bool includeGlobals) - : ClusterAnalysis(rm, stateMgr, b, includeGlobals), + : ClusterAnalysis(rm, stateMgr, b, includeGlobals), Ex(ex), Count(count), IS(is), Regions(r) {} void VisitCluster(const MemRegion *baseR, BindingKey *I, BindingKey *E); @@ -595,7 +593,7 @@ private: }; } -void InvalidateRegionsWorker::VisitBinding(SVal V) { +void invalidateRegionsWorker::VisitBinding(SVal V) { // A symbol? Mark it touched by the invalidation. if (IS) if (SymbolRef Sym = V.getAsSymbol()) @@ -623,7 +621,7 @@ void InvalidateRegionsWorker::VisitBinding(SVal V) { } } -void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR, +void invalidateRegionsWorker::VisitCluster(const MemRegion *baseR, BindingKey *I, BindingKey *E) { for ( ; I != E; ++I) { // Get the old binding. Is it a region? If so, add it to the worklist. @@ -635,7 +633,7 @@ void InvalidateRegionsWorker::VisitCluster(const MemRegion *baseR, } } -void InvalidateRegionsWorker::VisitBaseRegion(const MemRegion *baseR) { +void invalidateRegionsWorker::VisitBaseRegion(const MemRegion *baseR) { if (IS) { // Symbolic region? Mark that symbol touched by the invalidation. if (const SymbolicRegion *SR = dyn_cast(baseR)) @@ -708,14 +706,14 @@ void InvalidateRegionsWorker::VisitBaseRegion(const MemRegion *baseR) { B = RM.addBinding(B, baseR, BindingKey::Direct, V); } -Store RegionStoreManager::InvalidateRegions(Store store, +Store RegionStoreManager::invalidateRegions(Store store, const MemRegion * const *I, const MemRegion * const *E, const Expr *Ex, unsigned Count, InvalidatedSymbols *IS, bool invalidateGlobals, InvalidatedRegions *Regions) { - InvalidateRegionsWorker W(*this, StateMgr, + invalidateRegionsWorker W(*this, StateMgr, RegionStoreManager::GetRegionBindings(store), Ex, Count, IS, Regions, invalidateGlobals); diff --git a/lib/StaticAnalyzer/Core/SValBuilder.cpp b/lib/StaticAnalyzer/Core/SValBuilder.cpp index b3a8a5c93b..b2ffcbda71 100644 --- a/lib/StaticAnalyzer/Core/SValBuilder.cpp +++ b/lib/StaticAnalyzer/Core/SValBuilder.cpp @@ -224,7 +224,7 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) { if (nonloc::LocAsInteger *LV = dyn_cast(&val)) { if (const MemRegion *R = LV->getLoc().getAsRegion()) { StoreManager &storeMgr = StateMgr.getStoreManager(); - R = storeMgr.CastRegion(R, castTy); + R = storeMgr.castRegion(R, castTy); return R ? SVal(loc::MemRegionVal(R)) : UnknownVal(); } return LV->getLoc(); @@ -299,7 +299,7 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) { // Delegate to store manager to get the result of casting a region to a // different type. If the MemRegion* returned is NULL, this expression // Evaluates to UnknownVal. - R = storeMgr.CastRegion(R, castTy); + R = storeMgr.castRegion(R, castTy); return R ? SVal(loc::MemRegionVal(R)) : UnknownVal(); } diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp index 3f5863e5c4..28f890b39c 100644 --- a/lib/StaticAnalyzer/Core/Store.cpp +++ b/lib/StaticAnalyzer/Core/Store.cpp @@ -51,7 +51,7 @@ const ElementRegion *StoreManager::GetElementZeroRegion(const MemRegion *R, return MRMgr.getElementRegion(T, idx, R, Ctx); } -const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy) { +const MemRegion *StoreManager::castRegion(const MemRegion *R, QualType CastToTy) { ASTContext& Ctx = StateMgr.getContext();