const MemSpaceRegion *getMemorySpace() const;
- const MemRegion *getBaseRegion() const;
+ const MemRegion *StripCasts() const;
bool hasStackStorage() const;
return static_cast<MemRegion*>(Data);
}
- const MemRegion* getBaseRegion() const;
+ const MemRegion* StripCasts() const;
template <typename REGION>
const REGION* getRegionAs() const {
if (!LV)
return false;
- const TypedRegion* R = dyn_cast<TypedRegion>(LV->getBaseRegion());
+ const TypedRegion* R = dyn_cast<TypedRegion>(LV->StripCasts());
if (!R)
return false;
const Expr *E,
unsigned Count,
InvalidatedSymbols *IS) {
- R = R->getBaseRegion();
+ R = R->StripCasts();
if (!(isa<VarRegion>(R) || isa<ObjCIvarRegion>(R)))
return state;
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);
// 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)) {
ASTContext& Ctx = StateMgr.getContext();
// Strip away casts.
- R = R->getBaseRegion();
+ R = R->StripCasts();
// Get the mapping of regions -> subregions.
llvm::OwningPtr<RegionStoreSubRegionMap>
// 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();
}
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 {
// 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