16 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_MEMREGION_H
17 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_MEMREGION_H
27 #include "llvm/ADT/FoldingSet.h"
28 #include "llvm/Support/Allocator.h"
29 #include "llvm/Support/ErrorHandling.h"
34 class LocationContext;
35 class StackFrameContext;
40 class MemRegionManager;
82 #define REGION(Id, Parent) Id ## Kind,
83 #define REGION_RANGE(Id, First, Last) BEGIN_##Id = First, END_##Id = Last,
84 #include "clang/StaticAnalyzer/Core/PathSensitive/Regions.def"
97 virtual void Profile(llvm::FoldingSetNodeID&
ID)
const = 0;
150 template<
typename RegionTy>
const RegionTy*
getAs()
const;
193 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
197 return k >= BEGIN_MEMSPACES && k <= END_MEMSPACES;
213 return R->
getKind() == CodeSpaceRegionKind;
218 virtual void anchor();
228 return k >= BEGIN_GLOBAL_MEMSPACES && k <= END_GLOBAL_MEMSPACES;
248 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
255 return R->
getKind() == StaticGlobalSpaceRegionKind;
266 virtual void anchor()
override;
278 return k >= BEGIN_NON_STATIC_GLOBAL_MEMSPACES &&
279 k <= END_NON_STATIC_GLOBAL_MEMSPACES;
296 return R->
getKind() == GlobalSystemSpaceRegionKind;
316 return R->
getKind() == GlobalImmutableSpaceRegionKind;
334 return R->
getKind() == GlobalInternalSpaceRegionKind;
348 return R->
getKind() == HeapSpaceRegionKind;
362 return R->
getKind() == UnknownSpaceRegionKind;
367 virtual void anchor();
381 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
385 return k >= BEGIN_STACK_MEMSPACES && k <= END_STACK_MEMSPACES;
398 return R->
getKind() == StackLocalsSpaceRegionKind;
412 return R->
getKind() == StackArgumentsSpaceRegionKind;
420 virtual void anchor();
444 return R->
getKind() > END_MEMSPACES;
462 :
SubRegion(superRegion, AllocaRegionKind), Cnt(cnt), Ex(ex) {
466 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const Expr *Ex,
477 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
482 return R->
getKind() == AllocaRegionKind;
488 virtual void anchor()
override;
506 return k >= BEGIN_TYPED_REGIONS && k <= END_TYPED_REGIONS;
512 virtual void anchor()
override;
540 return k >= BEGIN_TYPED_VALUE_REGIONS && k <= END_TYPED_VALUE_REGIONS;
546 virtual void anchor()
override;
558 return k >= BEGIN_CODE_TEXT_REGIONS && k <= END_CODE_TEXT_REGIONS;
570 assert(isa<ObjCMethodDecl>(fd) || isa<FunctionDecl>(fd));
573 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const NamedDecl *FD,
579 if (
const FunctionDecl *D = dyn_cast<FunctionDecl>(FD)) {
583 assert(isa<ObjCMethodDecl>(FD));
584 assert(
false &&
"Getting the type of ObjCMethod is not supported yet");
597 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
600 return R->
getKind() == FunctionCodeRegionKind;
620 :
CodeTextRegion(sreg, BlockCodeRegionKind), BD(bd), AC(ac), locTy(lTy) {
626 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const BlockDecl *BD,
643 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
646 return R->
getKind() == BlockCodeRegionKind;
662 void *ReferencedVars;
667 :
TypedRegion(sreg, BlockDataRegionKind), BC(bc), LC(lc),
668 BlockCount(count), ReferencedVars(nullptr), OriginalVars(nullptr) {
671 assert(isa<GlobalImmutableSpaceRegion>(sreg) ||
672 isa<StackLocalsSpaceRegion>(sreg) ||
673 isa<UnknownSpaceRegion>(sreg));
676 static void ProfileRegion(llvm::FoldingSetNodeID&,
const BlockCodeRegion *,
693 : R(r), OriginalR(originalR) {}
696 return cast<VarRegion>(*R);
699 return cast<VarRegion>(*OriginalR);
703 assert((R ==
nullptr) == (I.R ==
nullptr));
707 assert((R ==
nullptr) == (I.R ==
nullptr));
726 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
729 return R->
getKind() == BlockDataRegionKind;
732 void LazyInitializeReferencedVars();
733 std::pair<const VarRegion *, const VarRegion *>
734 getCaptureRegions(
const VarDecl *VD);
748 :
SubRegion(sreg, SymbolicRegionKind), sym(s) {
753 assert(isa<UnknownSpaceRegion>(sreg) || isa<HeapSpaceRegion>(sreg));
765 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
774 return R->
getKind() == SymbolicRegionKind;
789 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
805 void Profile(llvm::FoldingSetNodeID&
ID)
const override {
812 return R->
getKind() == StringRegionKind;
828 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
842 void Profile(llvm::FoldingSetNodeID&
ID)
const override {
849 return R->
getKind() == ObjCStringRegionKind;
865 assert(isa<GlobalInternalSpaceRegion>(sReg) ||
866 isa<StackLocalsSpaceRegion>(sReg));
869 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
879 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
886 return R->
getKind() == CompoundLiteralRegionKind;
905 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
909 return k >= BEGIN_DECL_REGIONS && k <= END_DECL_REGIONS;
923 assert(isa<GlobalsSpaceRegion>(sReg) || isa<StackSpaceRegion>(sReg) ||
924 isa<BlockDataRegion>(sReg) || isa<UnknownSpaceRegion>(sReg));
927 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const VarDecl *VD,
933 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
947 return R->
getKind() == VarRegionKind;
964 ThisPointerTy(thisPointerTy) {}
966 static void ProfileRegion(llvm::FoldingSetNodeID &
ID,
971 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
980 return R->
getKind() == CXXThisRegionKind;
993 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const FieldDecl *FD,
1009 return R->
getKind() == FieldRegionKind;
1025 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const ObjCIvarDecl *ivd,
1038 return R->
getKind() == ObjCIvarRegionKind;
1045 class ElementRegion;
1054 : Region(reg),
Offset(offset) {}
1074 ElementType(elementType), Index(Idx) {
1077 "The index must be signed");
1080 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
QualType elementType,
1099 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
1102 return R->
getKind() == ElementRegionKind;
1115 assert(isa<StackLocalsSpaceRegion>(sReg) ||
1116 isa<GlobalInternalSpaceRegion>(sReg));
1119 static void ProfileRegion(llvm::FoldingSetNodeID &
ID,
1131 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
1134 return R->
getKind() == CXXTempObjectRegionKind;
1143 llvm::PointerIntPair<const CXXRecordDecl *, 1, bool> Data;
1151 static void ProfileRegion(llvm::FoldingSetNodeID &
ID,
const CXXRecordDecl *RD,
1162 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
1165 return region->
getKind() == CXXBaseObjectRegionKind;
1173 template<
typename RegionTy>
1175 if (
const RegionTy* RT = dyn_cast<RegionTy>(
this))
1187 llvm::BumpPtrAllocator& A;
1188 llvm::FoldingSet<MemRegion> Regions;
1195 llvm::DenseMap<const StackFrameContext *, StackLocalsSpaceRegion *>
1196 StackLocalsSpaceRegions;
1197 llvm::DenseMap<const StackFrameContext *, StackArgumentsSpaceRegion *>
1198 StackArgumentsSpaceRegions;
1199 llvm::DenseMap<const CodeTextRegion *, StaticGlobalSpaceRegion *>
1200 StaticsGlobalSpaceRegions;
1208 : C(c), A(a), InternalGlobals(nullptr), SystemGlobals(nullptr),
1209 ImmutableGlobals(nullptr), heap(nullptr), unknown(nullptr),
1339 unsigned blockCount);
1347 template <
typename RegionTy,
typename SuperTy,
1349 RegionTy* getSubRegion(
const Arg1Ty arg1,
1350 const SuperTy* superRegion);
1352 template <
typename RegionTy,
typename SuperTy,
1353 typename Arg1Ty,
typename Arg2Ty>
1354 RegionTy* getSubRegion(
const Arg1Ty arg1,
const Arg2Ty arg2,
1355 const SuperTy* superRegion);
1357 template <
typename RegionTy,
typename SuperTy,
1358 typename Arg1Ty,
typename Arg2Ty,
typename Arg3Ty>
1359 RegionTy* getSubRegion(
const Arg1Ty arg1,
const Arg2Ty arg2,
1361 const SuperTy* superRegion);
1363 template <
typename REG>
1364 const REG* LazyAllocate(REG*& region);
1366 template <
typename REG,
typename ARG>
1367 const REG* LazyAllocate(REG*& region, ARG a);
1384 typedef unsigned char StorageTypeForKinds;
1385 llvm::DenseMap<const MemRegion *, StorageTypeForKinds> MRTraitsMap;
1386 llvm::DenseMap<SymbolRef, StorageTypeForKinds> SymTraitsMap;
1388 typedef llvm::DenseMap<const MemRegion *, StorageTypeForKinds>::const_iterator
1389 const_region_iterator;
1390 typedef llvm::DenseMap<SymbolRef, StorageTypeForKinds>::const_iterator
1391 const_symbol_iterator;
Suppress pointer-escaping of a region.
bool hasStackStorage() const
RegionOffset(const MemRegion *r, int64_t off)
const ElementRegion * getElementRegionWithSuper(const ElementRegion *ER, const SubRegion *superRegion)
bool isBoundable() const override
Defines the clang::ASTContext interface.
void dumpToStream(raw_ostream &os) const override
CodeTextRegion(const MemSpaceRegion *sreg, Kind k)
FunctionDecl - An instance of this class is created to represent a function declaration or definition...
TypedValueRegion - An abstract class representing regions having a typed value.
static bool classof(const MemRegion *R)
CompoundLiteralRegion - A memory region representing a compound literal.
QualType getValueType() const override
PointerType - C99 6.7.5.1 - Pointer Declarators.
A (possibly-)qualified type.
MemRegion - The root abstract class for all memory regions.
virtual DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const
getExtent - Returns the size of the region in bytes.
virtual bool canPrintPretty() const
Returns true if this region can be printed in a user-friendly way.
SubRegion(const MemRegion *sReg, Kind k)
const Decl * getDecl() const
const CodeTextRegion * getCodeRegion() const
Information about invalidation for a particular region/symbol.
MemRegionManager * getMemRegionManager() const override
const StackFrameContext * getStackFrame() const
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression...
bool hasGlobalsOrParametersStorage() const
BlockCodeRegion - A region that represents code texts of blocks (closures).
Decl - This represents one declaration (or definition), e.g.
virtual QualType getValueType() const =0
virtual bool isBoundable() const
void dumpToStream(raw_ostream &os) const override
const StringRegion * getStringRegion(const StringLiteral *Str)
static bool classof(const MemRegion *R)
static bool classof(const MemRegion *R)
const RegionTy * getAs() const
const GlobalsSpaceRegion * getGlobalsRegion(MemRegion::Kind K=MemRegion::GlobalInternalSpaceRegionKind, const CodeTextRegion *R=nullptr)
getGlobalsRegion - Retrieve the memory region associated with global variables.
QualType getLocationType() const override
CharUnits getOffset() const
std::string getDescriptiveName(bool UseQuotes=true) const
Get descriptive name for memory region.
MemSpaceRegion - A memory region that represents a "memory space"; for example, the set of global var...
static bool classof(const MemRegion *region)
bool isBlockPointerType() const
AnalysisDeclContext * getAnalysisDeclContext() const
static bool classof(const MemRegion *R)
Value representing integer constant.
const ObjCIvarRegion * getObjCIvarRegion(const ObjCIvarDecl *ivd, const SubRegion *superRegion)
getObjCIvarRegion - Retrieve or create the memory region associated with a specified Objective-c inst...
const CXXBaseObjectRegion * getCXXBaseObjectRegionWithSuper(const CXXBaseObjectRegion *baseReg, const SubRegion *superRegion)
Create a CXXBaseObjectRegion with the same CXXRecordDecl but a different super region.
AllocaRegion - A region that represents an untyped blob of bytes created by a call to 'alloca'...
static bool classof(const MemRegion *R)
CodeSpaceRegion - The memory space that holds the executable code of functions and blocks...
const StackArgumentsSpaceRegion * getStackArgumentsRegion(const StackFrameContext *STC)
getStackArgumentsRegion - Retrieve the memory region associated with function/method arguments of the...
ASTContext & getContext()
VarDecl - An instance of this class is created to represent a variable declaration or definition...
void printPretty(raw_ostream &os) const override
Print the region for use in diagnostics.
referenced_vars_iterator referenced_vars_begin() const
CompoundLiteralExpr - [C99 6.5.2.5].
void Profile(llvm::FoldingSetNodeID &ID) const override
const Expr * getExpr() const
void setTrait(SymbolRef Sym, InvalidationKinds IK)
QualType getElementType() const
void Profile(llvm::FoldingSetNodeID &ID) const override
std::string getString() const
Get a string representation of a region for debug use.
const ObjCStringRegion * getObjCStringRegion(const ObjCStringLiteral *Str)
const MemRegion * getBaseRegion() const
referenced_vars_iterator referenced_vars_end() const
CXXThisRegion - Represents the region for the implicit 'this' parameter in a call to a C++ method...
const MemSpaceRegion * getMemorySpace() const
const BlockDecl * getDecl() const
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
GlobalsSpaceRegion(MemRegionManager *mgr, Kind k)
The region containing globals which can be modified by calls to "internally" defined functions - (for...
const HeapSpaceRegion * getHeapRegion()
getHeapRegion - Retrieve the memory region associated with the generic "heap".
The region associated with an ObjCStringLiteral.
void Profile(llvm::FoldingSetNodeID &ID) const override
Represents a class type in Objective C.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool isReferenceType() const
FieldDecl - An instance of this class is created by Sema::ActOnField to represent a member of a struc...
AnalysisDeclContext contains the context data for the function or method under analysis.
bool isAnyPointerType() const
const MemRegion * getRegion() const
bool hasStackParametersStorage() const
const StackLocalsSpaceRegion * getStackLocalsRegion(const StackFrameContext *STC)
getStackLocalsRegion - Retrieve the memory region associated with the specified stack frame...
QualType getLocationType() const override
void Profile(llvm::FoldingSetNodeID &ID) const override
static CharUnits Zero()
Zero - Construct a CharUnits quantity of zero.
const CXXRecordDecl * getDecl() const
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
QualType getValueType() const override
bool isBoundable() const override
The region containing globals which are considered not to be modified or point to data which could be...
const SymbolicRegion * getSymbolicRegion(SymbolRef Sym)
Retrieve or create a "symbolic" memory region.
void Profile(llvm::FoldingSetNodeID &ID) const override
static bool classof(const MemRegion *R)
const VarDecl * getDecl() const
RegionRawOffset getAsArrayOffset() const
Compute the offset within the array. The array might also be a subobject.
BlockDataRegion - A region that represents a block instance.
const AllocaRegion * getAllocaRegion(const Expr *Ex, unsigned Cnt, const LocationContext *LC)
getAllocaRegion - Retrieve a region associated with a call to alloca().
const SymbolicRegion * getSymbolicBase() const
If this is a symbolic region, returns the region.
static bool classof(const MemRegion *R)
const ObjCIvarDecl * getDecl() const
const UnknownSpaceRegion * getUnknownRegion()
getUnknownRegion - Retrieve the memory region associated with unknown memory space.
CharUnits - This is an opaque type for sizes expressed in character units.
void dumpToStream(raw_ostream &os) const override
const StringLiteral * getStringLiteral() const
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified...
QualType getValueType() const override
referenced_vars_iterator(const MemRegion *const *r, const MemRegion *const *originalR)
SymbolRef getSymbol() const
void Profile(llvm::FoldingSetNodeID &ID) const override
void Profile(llvm::FoldingSetNodeID &ID) const override
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
static bool classof(const MemRegion *R)
ObjCStringLiteral, used for Objective-C string literals i.e.
void Profile(llvm::FoldingSetNodeID &ID) const override
static bool classof(const MemRegion *R)
void dumpToStream(raw_ostream &os) const override
void dumpToStream(raw_ostream &os) const override
bool operator==(const referenced_vars_iterator &I) const
void dumpToStream(raw_ostream &os) const override
QualType getValueType() const override
detail::InMemoryDirectory::const_iterator I
Represent a region's offset within the top level base region.
virtual void printPrettyAsExpr(raw_ostream &os) const
Print the region as expression.
void Profile(llvm::FoldingSetNodeID &ID) const override
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const Decl *D, const MemRegion *superRegion, Kind k)
virtual QualType getType() const =0
bool canPrintPretty() const override
Returns true if this region can be printed in a user-friendly way.
const BlockCodeRegion * getBlockCodeRegion(const BlockDecl *BD, CanQualType locTy, AnalysisDeclContext *AC)
const MemRegion * getSuperRegion() const
static bool classof(const MemRegion *R)
void dumpToStream(raw_ostream &os) const override
const CodeSpaceRegion * getCodeRegion()
const StackFrameContext * getStackFrame() const
QualType getValueType() const override
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
When applied to a MemSpaceRegion, indicates the entire memory space should be invalidated.
const Expr * getExpr() const
const MemRegion * StripCasts(bool StripBaseCasts=true) const
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
static bool classof(const MemRegion *R)
const VarRegion * getOriginalRegion(const VarRegion *VR) const
Return the original region for a captured region, if one exists.
SymbolicRegion - A special, "non-concrete" region.
QualType getDesugaredLocationType(ASTContext &Context) const
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression...
const Type * getTypePtrOrNull() const
BlockDecl - This represents a block literal declaration, which is like an unnamed FunctionDecl...
Expr - This represents one expression.
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
TypedValueRegion(const MemRegion *sReg, Kind k)
virtual bool canPrintPrettyAsExpr() const
Returns true if this region's textual representation can be used as part of a larger expression...
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression...
const VarRegion * getCapturedRegion() const
QualType getDesugaredValueType(ASTContext &Context) const
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
bool hasSymbolicOffset() const
void dumpToStream(raw_ostream &os) const override
Optional< T > getAs() const
Convert to the specified SVal type, returning None if this SVal is not of the desired type...
static const int64_t Symbolic
llvm::BumpPtrAllocator & getAllocator()
static bool classof(const MemRegion *R)
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
bool hasTrait(SymbolRef Sym, InvalidationKinds IK) const
void Profile(llvm::FoldingSetNodeID &ID) const override
static bool classof(const MemRegion *R)
static bool classof(const MemRegion *R)
static bool classof(const MemRegion *R)
static bool classof(const MemRegion *R)
TypedRegion(const MemRegion *sReg, Kind k)
The region of the static variables within the current CodeTextRegion scope.
The region for all the non-static global variables.
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
bool operator!=(const referenced_vars_iterator &I) const
QualType getValueType() const override
static bool classof(const MemRegion *R)
const ObjCStringLiteral * getObjCStringLiteral() const
FunctionCodeRegion - A region that represents code texts of function.
ASTContext & getContext() const
virtual void dumpToStream(raw_ostream &os) const
bool isBoundable() const override
static bool classof(const MemRegion *R)
const FieldDecl * getDecl() const
void dumpToStream(raw_ostream &os) const override
const CXXTempObjectRegion * getCXXTempObjectRegion(Expr const *Ex, LocationContext const *LC)
bool isSubRegionOf(const MemRegion *R) const override
Check if the region is a subregion of the given region.
void dumpToStream(raw_ostream &os) const override
void dumpToStream(raw_ostream &os) const override
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
const VarRegion * getOriginalRegion() const
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
void dumpToStream(raw_ostream &os) const override
bool isBoundable() const override
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
virtual void printPretty(raw_ostream &os) const
Print the region for use in diagnostics.
const CompoundLiteralRegion * getCompoundLiteralRegion(const CompoundLiteralExpr *CL, const LocationContext *LC)
getCompoundLiteralRegion - Retrieve the region associated with a given CompoundLiteral.
void Profile(llvm::FoldingSetNodeID &ID) const override
QualType getLocationType() const override
static bool classof(const MemRegion *R)
void dumpToStream(raw_ostream &os) const override
Tells that a region's contents is not changed.
static bool classof(const MemRegion *R)
const CXXThisRegion * getCXXThisRegion(QualType thisPointerTy, const LocationContext *LC)
getCXXThisRegion - Retrieve the [artificial] region associated with the parameter 'this'...
bool isBoundable() const override
const CXXBaseObjectRegion * getCXXBaseObjectRegion(const CXXRecordDecl *BaseClass, const SubRegion *Super, bool IsVirtual)
Create a CXXBaseObjectRegion with the given base class for region Super.
RegionOffset getAsOffset() const
Compute the offset within the top level memory object.
static bool classof(const MemRegion *R)
const SymbolicRegion * getSymbolicHeapRegion(SymbolRef sym)
Return a unique symbolic region belonging to heap memory space.
QualType getValueType() const override
clang::SourceRange sourceRange() const
Retrieve source range from memory region.
QualType getValueType() const override
const NamedDecl * getDecl() const
const VarRegion * getVarRegion(const VarDecl *D, const LocationContext *LC)
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and LocationC...
InvalidationKinds
Describes different invalidation traits.
const BlockDecl * getDecl() const
const ElementRegion * getElementRegion(QualType elementType, NonLoc Idx, const SubRegion *superRegion, ASTContext &Ctx)
getElementRegion - Retrieve the memory region associated with the associated element type...
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
bool isBoundable() const override
QualType getObjCObjectPointerType(QualType OIT) const
Return a ObjCObjectPointerType type for the given ObjCObjectType.
virtual void Profile(llvm::FoldingSetNodeID &ID) const =0
detail::InMemoryDirectory::const_iterator E
void Profile(llvm::FoldingSetNodeID &ID) const override
QualType getLocationType() const override
static bool classof(const MemRegion *R)
void dumpToStream(raw_ostream &os) const override
const FunctionCodeRegion * getFunctionCodeRegion(const NamedDecl *FD)
const CXXTempObjectRegion * getCXXStaticTempObjectRegion(const Expr *Ex)
Create a CXXTempObjectRegion for temporaries which are lifetime-extended by static references...
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
virtual MemRegionManager * getMemRegionManager() const =0
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
bool isBoundable() const override
const T * getAs() const
Member-template getAs<specific type>'.
SubRegion - A region that subsets another larger region.
The region containing globals which are defined in system/external headers and are considered modifia...
int64_t getOffset() const
StackSpaceRegion(MemRegionManager *mgr, Kind k, const StackFrameContext *sfc)
const CompoundLiteralExpr * getLiteralExpr() const
referenced_vars_iterator & operator++()
void Profile(llvm::FoldingSetNodeID &ID) const override
static raw_ostream & operator<<(raw_ostream &os, const clang::ento::MemRegion *R)
const BlockDataRegion * getBlockDataRegion(const BlockCodeRegion *bc, const LocationContext *lc, unsigned blockCount)
getBlockDataRegion - Get the memory region associated with an instance of a block.
MemRegionManager * getMemRegionManager() const override
MemSpaceRegion(MemRegionManager *mgr, Kind k)
void Profile(llvm::FoldingSetNodeID &ID) const override
void Profile(llvm::FoldingSetNodeID &ID) const override
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate.h) and friends (in DeclFriend.h).
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression...
void dumpToStream(raw_ostream &os) const
static void ProfileRegion(llvm::FoldingSetNodeID &ID, SymbolRef sym, const MemRegion *superRegion)
Represents a C++ struct/union/class.
void dumpToStream(raw_ostream &os) const override
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
static bool classof(const MemRegion *R)
void Profile(llvm::FoldingSetNodeID &ID) const override
ObjCIvarDecl - Represents an ObjC instance variable.
const BlockCodeRegion * getCodeRegion() const
QualType getValueType() const override
static bool classof(const MemRegion *R)
static bool classof(const MemRegion *R)
DeclRegion(const Decl *d, const MemRegion *sReg, Kind k)
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
StringLiteral - This represents a string literal expression, e.g.
void dumpToStream(raw_ostream &os) const override
StringRegion - Region associated with a StringLiteral.
const FieldRegion * getFieldRegionWithSuper(const FieldRegion *FR, const SubRegion *superRegion)
void Profile(llvm::FoldingSetNodeID &ID) const override
ElementRegin is used to represent both array elements and casts.
QualType getValueType() const override
MemRegionManager(ASTContext &c, llvm::BumpPtrAllocator &a)
const MemRegion * getRegion() const
virtual bool isSubRegionOf(const MemRegion *R) const
Check if the region is a subregion of the given region.
void dumpToStream(raw_ostream &os) const override
A trivial tuple used to represent a source range.
bool hasStackNonParametersStorage() const
NamedDecl - This represents a decl with a name.
static bool classof(const MemRegion *R)
const MemRegion * superRegion
const llvm::APSInt & getValue() const
T castAs() const
Convert to the specified SVal type, asserting that this SVal is of the desired type.
void dumpToStream(raw_ostream &os) const override
static bool classof(const MemRegion *R)
bool isBoundable() const override
const FieldRegion * getFieldRegion(const FieldDecl *fd, const SubRegion *superRegion)
getFieldRegion - Retrieve or create the memory region associated with a specified FieldDecl...
void dumpToStream(raw_ostream &os) const override
NonStaticGlobalSpaceRegion(MemRegionManager *mgr, Kind k)
TypedRegion - An abstract class representing regions that are typed.
static bool classof(const MemRegion *R)
void dumpToStream(raw_ostream &os) const override
virtual QualType getLocationType() const =0