class MemRegion
Declaration
class MemRegion : public Node { /* full declaration omitted */ };Description
MemRegion - The root abstract class for all memory regions.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:95
Inherits from: FoldingSetBase::Node
Member Variables
- private const clang::ento::MemRegion::Kind kind
- private Optional<clang::ento::RegionOffset> cachedOffset
Method Overview
- protected MemRegion(clang::ento::MemRegion::Kind k)
- public virtual void Profile(llvm::FoldingSetNodeID & ID) const
- public const clang::ento::MemRegion * StripCasts(bool StripBaseAndDerivedCasts = true) const
- public virtual bool canPrintPretty() const
- public virtual bool canPrintPrettyAsExpr() const
- public template <typename RegionTy>const RegionTy * castAs() const
- public void dump() const
- public virtual void dumpToStream(llvm::raw_ostream & os) const
- public template <typename RegionTy>const RegionTy * getAs() const
- public clang::ento::RegionOffset getAsOffset() const
- public const clang::ento::MemRegion * getBaseRegion() const
- public clang::ASTContext & getContext() const
- public std::string getDescriptiveName(bool UseQuotes = true) const
- public clang::ento::MemRegion::Kind getKind() const
- public virtual clang::ento::MemRegionManager & getMemRegionManager() const
- public const clang::ento::MemSpaceRegion * getMemorySpace() const
- public const clang::ento::MemRegion * getMostDerivedObjectRegion() const
- public std::string getString() const
- public const clang::ento::SymbolicRegion * getSymbolicBase() const
- public bool hasGlobalsOrParametersStorage() const
- public bool hasStackNonParametersStorage() const
- public bool hasStackParametersStorage() const
- public bool hasStackStorage() const
- public virtual bool isBoundable() const
- public virtual bool isSubRegionOf(const clang::ento::MemRegion * R) const
- public virtual void printPretty(llvm::raw_ostream & os) const
- public virtual void printPrettyAsExpr(llvm::raw_ostream & os) const
- public clang::SourceRange sourceRange() const
- protected virtual ~MemRegion()
Inherited from FoldingSetBase::Node:
Methods
¶MemRegion(clang::ento::MemRegion::Kind k)
MemRegion(clang::ento::MemRegion::Kind k)Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:108
Parameters
- clang::ento::MemRegion::Kind k
¶virtual void Profile(
llvm::FoldingSetNodeID& ID) const
virtual void Profile(
llvm::FoldingSetNodeID& ID) constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:114
Parameters
¶const clang::ento::MemRegion* StripCasts(
bool StripBaseAndDerivedCasts = true) const
const clang::ento::MemRegion* StripCasts(
bool StripBaseAndDerivedCasts = true) constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:132
Parameters
- bool StripBaseAndDerivedCasts = true
¶virtual bool canPrintPretty() const
virtual bool canPrintPretty() constDescription
Returns true if this region can be printed in a user-friendly way.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:158
¶virtual bool canPrintPrettyAsExpr() const
virtual bool canPrintPrettyAsExpr() constDescription
Returns true if this region's textual representation can be used as part of a larger expression.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:165
¶template <typename RegionTy>
const RegionTy* castAs() const
template <typename RegionTy>
const RegionTy* castAs() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:177
Templates
- RegionTy
¶void dump() const
void dump() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:155
¶virtual void dumpToStream(
llvm::raw_ostream& os) const
virtual void dumpToStream(
llvm::raw_ostream& os) constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:153
Parameters
¶template <typename RegionTy>
const RegionTy* getAs() const
template <typename RegionTy>
const RegionTy* getAs() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:175
Templates
- RegionTy
¶clang::ento::RegionOffset getAsOffset() const
clang::ento::RegionOffset getAsOffset() constDescription
Compute the offset within the top level memory object.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:148
¶const clang::ento::MemRegion* getBaseRegion()
const
const clang::ento::MemRegion* getBaseRegion()
constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:120
¶clang::ASTContext& getContext() const
clang::ASTContext& getContext() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:112
¶std::string getDescriptiveName(
bool UseQuotes = true) const
std::string getDescriptiveName(
bool UseQuotes = true) constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:189
Parameters
- bool UseQuotes = true
- Set if the name should be quoted.
Returns
variable name for memory region
¶clang::ento::MemRegion::Kind getKind() const
clang::ento::MemRegion::Kind getKind() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:173
¶virtual clang::ento::MemRegionManager&
getMemRegionManager() const
virtual clang::ento::MemRegionManager&
getMemRegionManager() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:116
¶const clang::ento::MemSpaceRegion*
getMemorySpace() const
const clang::ento::MemSpaceRegion*
getMemorySpace() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:118
¶const clang::ento::MemRegion*
getMostDerivedObjectRegion() const
const clang::ento::MemRegion*
getMostDerivedObjectRegion() constDescription
Recursively retrieve the region of the most derived class instance of regions of C++ base class instances.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:125
¶std::string getString() const
std::string getString() constDescription
Get a string representation of a region for debug use.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:151
¶const clang::ento::SymbolicRegion*
getSymbolicBase() const
const clang::ento::SymbolicRegion*
getSymbolicBase() constDescription
If this is a symbolic region, returns the region. Otherwise, goes up the base chain looking for the first symbolic base region. It might return null.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:137
¶bool hasGlobalsOrParametersStorage() const
bool hasGlobalsOrParametersStorage() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:139
¶bool hasStackNonParametersStorage() const
bool hasStackNonParametersStorage() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:143
¶bool hasStackParametersStorage() const
bool hasStackParametersStorage() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:145
¶bool hasStackStorage() const
bool hasStackStorage() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:141
¶virtual bool isBoundable() const
virtual bool isBoundable() constDeclared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:179
¶virtual bool isSubRegionOf(
const clang::ento::MemRegion* R) const
virtual bool isSubRegionOf(
const clang::ento::MemRegion* R) constDescription
Check if the region is a subregion of the given region. Each region is a subregion of itself.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:129
Parameters
- const clang::ento::MemRegion* R
¶virtual void printPretty(
llvm::raw_ostream& os) const
virtual void printPretty(
llvm::raw_ostream& os) constDescription
Print the region for use in diagnostics.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:161
Parameters
¶virtual void printPrettyAsExpr(
llvm::raw_ostream& os) const
virtual void printPrettyAsExpr(
llvm::raw_ostream& os) constDescription
Print the region as expression. When this region represents a subexpression, the method is for printing an expression containing it.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:171
Parameters
¶clang::SourceRange sourceRange() const
clang::SourceRange sourceRange() constDescription
Retrieve source range from memory region. The range retrieval is based on the decl obtained from the memory region. For a VarRegion the range of the base region is returned. For a FieldRegion the range of the field is returned. If no declaration is found, an empty source range is returned. The client is responsible for checking if the returned range is valid.
Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:199
Returns
source range for declaration retrieved from memory region
¶virtual ~MemRegion()
virtual ~MemRegion()Declared at: clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h:109