diff options
Diffstat (limited to 'clang/include/clang/Checker/PathSensitive/MemRegion.h')
-rw-r--r-- | clang/include/clang/Checker/PathSensitive/MemRegion.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/include/clang/Checker/PathSensitive/MemRegion.h b/clang/include/clang/Checker/PathSensitive/MemRegion.h index 8425c3bd62d..48a7ad2aab1 100644 --- a/clang/include/clang/Checker/PathSensitive/MemRegion.h +++ b/clang/include/clang/Checker/PathSensitive/MemRegion.h @@ -34,6 +34,7 @@ class MemRegionManager; class MemSpaceRegion; class LocationContext; class StackFrameContext; +class ValueManager; class VarRegion; class CodeTextRegion; @@ -266,6 +267,11 @@ public: return superRegion; } + /// getExtent - Returns the size of the region in bytes. + virtual DefinedOrUnknownSVal getExtent(ValueManager& ValMgr) const { + return UnknownVal(); + } + MemRegionManager* getMemRegionManager() const; bool isSubRegionOf(const MemRegion* R) const; @@ -322,6 +328,8 @@ public: bool isBoundable() const { return true; } + DefinedOrUnknownSVal getExtent(ValueManager& ValMgr) const; + void Profile(llvm::FoldingSetNodeID& ID) const; static void ProfileRegion(llvm::FoldingSetNodeID& ID, const Expr* Ex, @@ -536,6 +544,8 @@ public: bool isBoundable() const { return true; } + DefinedOrUnknownSVal getExtent(ValueManager& ValMgr) const; + void Profile(llvm::FoldingSetNodeID& ID) const; static void ProfileRegion(llvm::FoldingSetNodeID& ID, @@ -570,6 +580,8 @@ public: return Str->getType(); } + DefinedOrUnknownSVal getExtent(ValueManager& ValMgr) const; + bool isBoundable() const { return false; } void Profile(llvm::FoldingSetNodeID& ID) const { @@ -629,6 +641,8 @@ public: const Decl* getDecl() const { return D; } void Profile(llvm::FoldingSetNodeID& ID) const; + DefinedOrUnknownSVal getExtent(ValueManager& ValMgr) const; + static bool classof(const MemRegion* R) { unsigned k = R->getKind(); return k >= BEG_DECL_REGIONS && k <= END_DECL_REGIONS; @@ -713,6 +727,8 @@ public: return C.getCanonicalType(getDecl()->getType()); } + DefinedOrUnknownSVal getExtent(ValueManager& ValMgr) const; + static void ProfileRegion(llvm::FoldingSetNodeID& ID, const FieldDecl* FD, const MemRegion* superRegion) { DeclRegion::ProfileRegion(ID, FD, superRegion, FieldRegionKind); |