[cfe-commits] r163762 - in /cfe/trunk: include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h lib/StaticAnalyzer/Core/MemRegion.cpp
Anna Zaks
ganna at apple.com
Wed Sep 12 17:37:13 PDT 2012
Author: zaks
Date: Wed Sep 12 19:37:12 2012
New Revision: 163762
URL: http://llvm.org/viewvc/llvm-project?rev=163762&view=rev
Log:
[analyzer] Don't reimplement an existing function.
Thanks Jordan.
Modified:
cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
cfe/trunk/lib/StaticAnalyzer/Core/MemRegion.cpp
Modified: cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h?rev=163762&r1=163761&r2=163762&view=diff
==============================================================================
--- cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h (original)
+++ cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h Wed Sep 12 19:37:12 2012
@@ -141,7 +141,7 @@
const MemRegion *getBaseRegion() const;
/// 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;
@@ -419,7 +419,7 @@
MemRegionManager* getMemRegionManager() const;
- bool isSubRegionOf(const MemRegion* R) const;
+ virtual bool isSubRegionOf(const MemRegion* R) const;
static bool classof(const MemRegion* R) {
return R->getKind() > END_MEMSPACES;
Modified: cfe/trunk/lib/StaticAnalyzer/Core/MemRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/MemRegion.cpp?rev=163762&r1=163761&r2=163762&view=diff
==============================================================================
--- cfe/trunk/lib/StaticAnalyzer/Core/MemRegion.cpp (original)
+++ cfe/trunk/lib/StaticAnalyzer/Core/MemRegion.cpp Wed Sep 12 19:37:12 2012
@@ -990,23 +990,7 @@
return R;
}
-bool MemRegion::isSubRegionOf(const MemRegion *PR) 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;
- }
+bool MemRegion::isSubRegionOf(const MemRegion *R) const {
return false;
}
More information about the cfe-commits
mailing list