]> granicus.if.org Git - clang/commitdiff
Rename: StripCasts describes what it does better.
authorZhongxing Xu <xuzhongxing@gmail.com>
Tue, 10 Nov 2009 02:17:20 +0000 (02:17 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Tue, 10 Nov 2009 02:17:20 +0000 (02:17 +0000)
getBaseRegion will be used in another method.

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

include/clang/Analysis/PathSensitive/MemRegion.h
include/clang/Analysis/PathSensitive/SVals.h
lib/Analysis/BasicObjCFoundationChecks.cpp
lib/Analysis/BasicStore.cpp
lib/Analysis/CFRefCount.cpp
lib/Analysis/MemRegion.cpp
lib/Analysis/RegionStore.cpp
lib/Analysis/SVals.cpp
lib/Analysis/Store.cpp

index 0e487691a89127c1b6a1d0bf13ef24d7b191d073..91db5982495b32426858fd5109435a3d079ff51e 100644 (file)
@@ -75,7 +75,7 @@ public:
 
   const MemSpaceRegion *getMemorySpace() const;
 
-  const MemRegion *getBaseRegion() const;
+  const MemRegion *StripCasts() const;
 
   bool hasStackStorage() const;
 
index cd737c97273d19ee29eed3048dd5cc67e8fa5cb5..8b5cf40e29cb39cfdff52f1d106d1d8cd72c5384 100644 (file)
@@ -436,7 +436,7 @@ public:
     return static_cast<MemRegion*>(Data);
   }
 
-  const MemRegion* getBaseRegion() const;
+  const MemRegion* StripCasts() const;
 
   template <typename REGION>
   const REGION* getRegionAs() const {
index 4781d5ec243e12d30415983a00c6094d3e0ef0e4..c2ecfa1f417f0992f6c32b8e0e17ed8752147b50 100644 (file)
@@ -384,7 +384,7 @@ bool AuditCFNumberCreate::Audit(ExplodedNode* N,GRStateManager&){
   if (!LV)
     return false;
 
-  const TypedRegion* R = dyn_cast<TypedRegion>(LV->getBaseRegion());
+  const TypedRegion* R = dyn_cast<TypedRegion>(LV->StripCasts());
 
   if (!R)
     return false;
index 888af9bd57a43de22fcbfc90211d0fe6a921d955..7a36a3ee08c4bd3a2d96e07f8be54357f621a42f 100644 (file)
@@ -624,7 +624,7 @@ const GRState *BasicStoreManager::InvalidateRegion(const GRState *state,
                                                    const Expr *E,
                                                    unsigned Count,
                                                    InvalidatedSymbols *IS) {
-  R = R->getBaseRegion();
+  R = R->StripCasts();
 
   if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
       return state;
index 03614e83398f89fdfeb7235d1e9257eb7fe4109a..f63c43ec42f7df5f5a590ee8d4ba5f51ff5ab231 100644 (file)
@@ -3050,7 +3050,7 @@ void CFRefCount::EvalObjCMessageExpr(ExplodedNodeSet& Dst,
           const LocationContext *LC = Pred->getLocationContext();
           if (const ImplicitParamDecl *SelfDecl = LC->getSelfDecl()) {
             SVal SelfVal = St->getSVal(St->getRegion(SelfDecl, LC));
-            if (L->getBaseRegion() == SelfVal.getAsRegion()) {
+            if (L->StripCasts() == SelfVal.getAsRegion()) {
               // Update the summary to make the default argument effect
               // 'StopTracking'.
               Summ = Summaries.copySummary(Summ);
index 353e63240294bc591d333bee922e8bf8605e98a9..ad3d36e79d10fe28b2a98354443b4850147514af 100644 (file)
@@ -382,7 +382,7 @@ bool MemRegion::hasGlobalsOrParametersStorage() const {
 // View handling.
 //===----------------------------------------------------------------------===//
 
-const MemRegion *MemRegion::getBaseRegion() const {
+const MemRegion *MemRegion::StripCasts() const {
   const MemRegion *R = this;
   while (true) {
     if (const ElementRegion *ER = dyn_cast<ElementRegion>(R)) {
index 8106260f18f053e4da5478020af4b7e9b5a18b71..91769cd447cdad7ff7b073af38a905b44ac84726 100644 (file)
@@ -461,7 +461,7 @@ const GRState *RegionStoreManager::InvalidateRegion(const GRState *state,
   ASTContext& Ctx = StateMgr.getContext();
 
   // Strip away casts.
-  R = R->getBaseRegion();
+  R = R->StripCasts();
 
   // Get the mapping of regions -> subregions.
   llvm::OwningPtr<RegionStoreSubRegionMap>
index e230d274c554b0abb324fcd67d00884928f2873d..d5d36e3b90909b884a8647a897fa4d6de4eb6f89 100644 (file)
@@ -63,7 +63,7 @@ const FunctionDecl *SVal::getAsFunctionDecl() const {
 // FIXME: should we consider SymbolRef wrapped in CodeTextRegion?
 SymbolRef SVal::getAsLocSymbol() const {
   if (const loc::MemRegionVal *X = dyn_cast<loc::MemRegionVal>(this)) {
-    const MemRegion *R = X->getBaseRegion();
+    const MemRegion *R = X->StripCasts();
     if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(R))
       return SymR->getSymbol();
   }
@@ -100,9 +100,9 @@ const MemRegion *SVal::getAsRegion() const {
   return 0;
 }
 
-const MemRegion *loc::MemRegionVal::getBaseRegion() const {
+const MemRegion *loc::MemRegionVal::StripCasts() const {
   const MemRegion *R = getRegion();
-  return R ?  R->getBaseRegion() : NULL;
+  return R ?  R->StripCasts() : NULL;
 }
 
 bool SVal::symbol_iterator::operator==(const symbol_iterator &X) const {
index 4b4ae6580820fe37192526e77fa874d96005d6ae..16af1be91ecef0be8e7c8712063c12dd63274e43 100644 (file)
@@ -43,7 +43,7 @@ const MemRegion *StoreManager::CastRegion(const MemRegion *R, QualType CastToTy)
 
   // Handle casts to Objective-C objects.
   if (CastToTy->isObjCObjectPointerType())
-    return R->getBaseRegion();
+    return R->StripCasts();
 
   if (CastToTy->isBlockPointerType()) {
     // FIXME: We may need different solutions, depending on the symbol