forked from OSchip/llvm-project
[analyzer] Don't reimplement an existing function.
Thanks Jordan. llvm-svn: 163762
This commit is contained in:
parent
bfacef45eb
commit
f6a5d793d2
|
@ -141,7 +141,7 @@ public:
|
||||||
const MemRegion *getBaseRegion() const;
|
const MemRegion *getBaseRegion() const;
|
||||||
|
|
||||||
/// Check if the region is a subregion of the given region.
|
/// Check if the region is a subregion of the given region.
|
||||||
bool isSubRegionOf(const MemRegion *PR) const;
|
virtual bool isSubRegionOf(const MemRegion *R) const;
|
||||||
|
|
||||||
const MemRegion *StripCasts(bool StripBaseCasts = true) const;
|
const MemRegion *StripCasts(bool StripBaseCasts = true) const;
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ public:
|
||||||
|
|
||||||
MemRegionManager* getMemRegionManager() const;
|
MemRegionManager* getMemRegionManager() const;
|
||||||
|
|
||||||
bool isSubRegionOf(const MemRegion* R) const;
|
virtual bool isSubRegionOf(const MemRegion* R) const;
|
||||||
|
|
||||||
static bool classof(const MemRegion* R) {
|
static bool classof(const MemRegion* R) {
|
||||||
return R->getKind() > END_MEMSPACES;
|
return R->getKind() > END_MEMSPACES;
|
||||||
|
|
|
@ -990,23 +990,7 @@ const MemRegion *MemRegion::getBaseRegion() const {
|
||||||
return R;
|
return R;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MemRegion::isSubRegionOf(const MemRegion *PR) const {
|
bool MemRegion::isSubRegionOf(const MemRegion *R) const {
|
||||||
const MemRegion *R = this;
|
|
||||||
while (true) {
|
|
||||||
switch (R->getKind()) {
|
|
||||||
case MemRegion::ElementRegionKind:
|
|
||||||
case MemRegion::FieldRegionKind:
|
|
||||||
case MemRegion::ObjCIvarRegionKind:
|
|
||||||
case MemRegion::CXXBaseObjectRegionKind:
|
|
||||||
R = cast<SubRegion>(R)->getSuperRegion();
|
|
||||||
if (R == PR)
|
|
||||||
return true;
|
|
||||||
continue;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue