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;
192 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
196 return k >= BEGIN_MEMSPACES && k <= END_MEMSPACES;
212 return R->
getKind() == CodeSpaceRegionKind;
217 virtual void anchor();
224 return k >= BEGIN_GLOBAL_MEMSPACES && k <= END_GLOBAL_MEMSPACES;
242 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
249 return R->
getKind() == StaticGlobalSpaceRegionKind;
268 return k >= BEGIN_NON_STATIC_GLOBAL_MEMSPACES &&
269 k <= END_NON_STATIC_GLOBAL_MEMSPACES;
286 return R->
getKind() == GlobalSystemSpaceRegionKind;
306 return R->
getKind() == GlobalImmutableSpaceRegionKind;
324 return R->
getKind() == GlobalInternalSpaceRegionKind;
329 virtual void anchor();
339 return R->
getKind() == HeapSpaceRegionKind;
344 virtual void anchor();
353 return R->
getKind() == UnknownSpaceRegionKind;
370 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
374 return k >= BEGIN_STACK_MEMSPACES && k <= END_STACK_MEMSPACES;
379 virtual void anchor();
388 return R->
getKind() == StackLocalsSpaceRegionKind;
394 virtual void anchor();
403 return R->
getKind() == StackArgumentsSpaceRegionKind;
412 virtual void anchor();
431 return R->
getKind() > END_MEMSPACES;
459 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
467 return R->
getKind() == AllocaRegionKind;
489 return k >= BEGIN_TYPED_REGIONS && k <= END_TYPED_REGIONS;
521 return k >= BEGIN_TYPED_VALUE_REGIONS && k <= END_TYPED_VALUE_REGIONS;
536 return k >= BEGIN_CODE_TEXT_REGIONS && k <= END_CODE_TEXT_REGIONS;
546 assert(isa<ObjCMethodDecl>(fd) || isa<FunctionDecl>(fd));
551 if (
const FunctionDecl *D = dyn_cast<FunctionDecl>(FD)) {
555 assert(isa<ObjCMethodDecl>(FD));
556 assert(
false &&
"Getting the type of ObjCMethod is not supported yet");
569 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
575 return R->
getKind() == FunctionCodeRegionKind;
595 :
CodeTextRegion(sreg, BlockCodeRegionKind), BD(bd), AC(ac), locTy(lTy) {}
610 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
617 return R->
getKind() == BlockCodeRegionKind;
632 void *ReferencedVars;
637 :
TypedRegion(sreg, BlockDataRegionKind), BC(bc), LC(lc),
639 ReferencedVars(nullptr), OriginalVars(nullptr) {}
654 : R(r), OriginalR(originalR) {}
657 return cast<VarRegion>(*R);
660 return cast<VarRegion>(*OriginalR);
664 assert((R ==
nullptr) == (I.R ==
nullptr));
668 assert((R ==
nullptr) == (I.R ==
nullptr));
687 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
694 return R->
getKind() == BlockDataRegionKind;
697 void LazyInitializeReferencedVars();
698 std::pair<const VarRegion *, const VarRegion *>
699 getCaptureRegions(
const VarDecl *VD);
723 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
732 return R->
getKind() == SymbolicRegionKind;
761 void Profile(llvm::FoldingSetNodeID&
ID)
const override {
768 return R->
getKind() == StringRegionKind;
795 void Profile(llvm::FoldingSetNodeID&
ID)
const override {
802 return R->
getKind() == ObjCStringRegionKind;
817 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
827 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
834 return R->
getKind() == CompoundLiteralRegionKind;
850 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
854 return k >= BEGIN_DECL_REGIONS && k <= END_DECL_REGIONS;
865 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const VarDecl *VD,
870 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
885 return R->
getKind() == VarRegionKind;
900 :
TypedValueRegion(sReg, CXXThisRegionKind), ThisPointerTy(thisPointerTy) {}
902 static void ProfileRegion(llvm::FoldingSetNodeID &
ID,
906 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
916 return R->
getKind() == CXXThisRegionKind;
945 return R->
getKind() == FieldRegionKind;
962 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
const ObjCIvarDecl *ivd,
975 return R->
getKind() == ObjCIvarRegionKind;
992 : Region(reg),
Offset(offset) {}
1012 ElementType(elementType), Index(Idx) {
1015 "The index must be signed");
1018 static void ProfileRegion(llvm::FoldingSetNodeID&
ID,
QualType elementType,
1037 void Profile(llvm::FoldingSetNodeID&
ID)
const override;
1040 return R->
getKind() == ElementRegionKind;
1053 static void ProfileRegion(llvm::FoldingSetNodeID &
ID,
1065 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
1068 return R->
getKind() == CXXTempObjectRegionKind;
1077 llvm::PointerIntPair<const CXXRecordDecl *, 1, bool> Data;
1083 static void ProfileRegion(llvm::FoldingSetNodeID &
ID,
const CXXRecordDecl *RD,
1094 void Profile(llvm::FoldingSetNodeID &
ID)
const override;
1097 return region->
getKind() == CXXBaseObjectRegionKind;
1105 template<
typename RegionTy>
1107 if (
const RegionTy* RT = dyn_cast<RegionTy>(
this))
1119 llvm::BumpPtrAllocator& A;
1120 llvm::FoldingSet<MemRegion> Regions;
1127 llvm::DenseMap<const StackFrameContext *, StackLocalsSpaceRegion *>
1128 StackLocalsSpaceRegions;
1129 llvm::DenseMap<const StackFrameContext *, StackArgumentsSpaceRegion *>
1130 StackArgumentsSpaceRegions;
1131 llvm::DenseMap<const CodeTextRegion *, StaticGlobalSpaceRegion *>
1132 StaticsGlobalSpaceRegions;
1140 : C(c), A(a), InternalGlobals(nullptr), SystemGlobals(nullptr),
1141 ImmutableGlobals(nullptr), heap(nullptr), unknown(nullptr),
1271 unsigned blockCount);
1279 template <
typename RegionTy,
typename A1>
1280 RegionTy* getRegion(
const A1 a1);
1282 template <
typename RegionTy,
typename A1>
1283 RegionTy* getSubRegion(
const A1 a1,
const MemRegion* superRegion);
1285 template <
typename RegionTy,
typename A1,
typename A2>
1286 RegionTy* getRegion(
const A1 a1,
const A2 a2);
1288 template <
typename RegionTy,
typename A1,
typename A2>
1289 RegionTy* getSubRegion(
const A1 a1,
const A2 a2,
1292 template <
typename RegionTy,
typename A1,
typename A2,
typename A3>
1293 RegionTy* getSubRegion(
const A1 a1,
const A2 a2,
const A3 a3,
1296 template <
typename REG>
1297 const REG* LazyAllocate(REG*& region);
1299 template <
typename REG,
typename ARG>
1300 const REG* LazyAllocate(REG*& region, ARG a);
1317 typedef unsigned char StorageTypeForKinds;
1318 llvm::DenseMap<const MemRegion *, StorageTypeForKinds> MRTraitsMap;
1319 llvm::DenseMap<SymbolRef, StorageTypeForKinds> SymTraitsMap;
1321 typedef llvm::DenseMap<const MemRegion *, StorageTypeForKinds>::const_iterator
1322 const_region_iterator;
1323 typedef llvm::DenseMap<SymbolRef, StorageTypeForKinds>::const_iterator
1324 const_symbol_iterator;
Suppress pointer-escaping of a region.
bool hasStackStorage() const
RegionOffset(const MemRegion *r, int64_t off)
bool isBoundable() const override
Defines the clang::ASTContext interface.
void dumpToStream(raw_ostream &os) const override
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.
const FieldRegion * getFieldRegion(const FieldDecl *fd, const MemRegion *superRegion)
getFieldRegion - Retrieve or create the memory region associated with a specified FieldDecl...
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...
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const FieldDecl *FD, const MemRegion *superRegion)
bool hasGlobalsOrParametersStorage() const
BlockCodeRegion - A region that represents code texts of blocks (closures).
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)
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const NamedDecl *FD, const MemRegion *)
AnalysisDeclContext * getAnalysisDeclContext() const
static bool classof(const MemRegion *R)
Value representing integer constant.
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.
AllocaRegion(const Expr *ex, unsigned cnt, const MemRegion *superRegion)
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 ...
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.
const MemRegion * getRegion() const
bool hasStackParametersStorage() const
const StackLocalsSpaceRegion * getStackLocalsRegion(const StackFrameContext *STC)
getStackLocalsRegion - Retrieve the memory region associated with the specified stack frame...
const ObjCIvarRegion * getObjCIvarRegion(const ObjCIvarDecl *ivd, const MemRegion *superRegion)
getObjCIvarRegion - Retrieve or create the memory region associated with a specified Objective-c inst...
QualType getLocationType() const override
void Profile(llvm::FoldingSetNodeID &ID) const override
const CXXBaseObjectRegion * getCXXBaseObjectRegionWithSuper(const CXXBaseObjectRegion *baseReg, const MemRegion *superRegion)
Create a CXXBaseObjectRegion with the same CXXRecordDecl but a different super region.
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.
CodeTextRegion(const MemRegion *sreg, Kind k)
ObjCStringRegion(const ObjCStringLiteral *str, const MemRegion *sreg)
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.
FunctionCodeRegion(const NamedDecl *fd, const MemRegion *sreg)
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
SymbolicRegion(const SymbolRef s, const MemRegion *sreg)
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
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const ObjCStringLiteral *Str, const MemRegion *superRegion)
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)
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 CXXBaseObjectRegion * getCXXBaseObjectRegion(const CXXRecordDecl *BaseClass, const MemRegion *Super, bool IsVirtual)
Create a CXXBaseObjectRegion with the given base class for region Super.
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.
const ElementRegion * getElementRegion(QualType elementType, NonLoc Idx, const MemRegion *superRegion, ASTContext &Ctx)
getElementRegion - Retrieve the memory region associated with the associated element type...
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
const ElementRegion * getElementRegionWithSuper(const ElementRegion *ER, const MemRegion *superRegion)
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
StringRegion(const StringLiteral *str, const MemRegion *sreg)
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.
static void ProfileRegion(llvm::FoldingSetNodeID &, const BlockCodeRegion *, const LocationContext *, unsigned, const MemRegion *)
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
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Ctx)
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
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.
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const BlockDecl *BD, CanQualType, const AnalysisDeclContext *, const MemRegion *)
QualType getValueType() const override
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const Expr *Ex, unsigned Cnt, const MemRegion *superRegion)
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
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const StringLiteral *Str, const MemRegion *superRegion)
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...
const FieldRegion * getFieldRegionWithSuper(const FieldRegion *FR, const MemRegion *superRegion)
int64_t getOffset() const
StackSpaceRegion(MemRegionManager *mgr, Kind k, const StackFrameContext *sfc)
const CompoundLiteralExpr * getLiteralExpr() const
referenced_vars_iterator & operator++()
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)
StringLiteral - This represents a string literal expression, e.g.
void dumpToStream(raw_ostream &os) const override
StringRegion - Region associated with a StringLiteral.
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
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