25 #include "llvm/Support/raw_ostream.h"
27 using namespace clang;
36 template <
typename RegionTy,
typename A1>
37 RegionTy* MemRegionManager::getRegion(
const A1 a1) {
42 llvm::FoldingSetNodeID
ID;
43 RegionTy::ProfileRegion(ID, a1, superRegion);
45 RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
49 R = (RegionTy*) A.Allocate<RegionTy>();
50 new (R) RegionTy(a1, superRegion);
51 Regions.InsertNode(R, InsertPos);
57 template <
typename RegionTy,
typename A1>
58 RegionTy* MemRegionManager::getSubRegion(
const A1 a1,
60 llvm::FoldingSetNodeID
ID;
61 RegionTy::ProfileRegion(ID, a1, superRegion);
63 RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
67 R = (RegionTy*) A.Allocate<RegionTy>();
68 new (R) RegionTy(a1, superRegion);
69 Regions.InsertNode(R, InsertPos);
75 template <
typename RegionTy,
typename A1,
typename A2>
76 RegionTy* MemRegionManager::getRegion(
const A1 a1,
const A2 a2) {
81 llvm::FoldingSetNodeID
ID;
82 RegionTy::ProfileRegion(ID, a1, a2, superRegion);
84 RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
88 R = (RegionTy*) A.Allocate<RegionTy>();
89 new (R) RegionTy(a1, a2, superRegion);
90 Regions.InsertNode(R, InsertPos);
96 template <
typename RegionTy,
typename A1,
typename A2>
97 RegionTy* MemRegionManager::getSubRegion(
const A1 a1,
const A2 a2,
100 llvm::FoldingSetNodeID
ID;
101 RegionTy::ProfileRegion(ID, a1, a2, superRegion);
103 RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
107 R = (RegionTy*) A.Allocate<RegionTy>();
108 new (R) RegionTy(a1, a2, superRegion);
109 Regions.InsertNode(R, InsertPos);
115 template <
typename RegionTy,
typename A1,
typename A2,
typename A3>
116 RegionTy* MemRegionManager::getSubRegion(
const A1 a1,
const A2 a2,
const A3 a3,
119 llvm::FoldingSetNodeID
ID;
120 RegionTy::ProfileRegion(ID, a1, a2, a3, superRegion);
122 RegionTy* R = cast_or_null<RegionTy>(Regions.FindNodeOrInsertPos(ID,
126 R = (RegionTy*) A.Allocate<RegionTy>();
127 new (R) RegionTy(a1, a2, a3, superRegion);
128 Regions.InsertNode(R, InsertPos);
151 while (r !=
nullptr) {
154 if (
const SubRegion* sr = dyn_cast<SubRegion>(r))
155 r = sr->getSuperRegion();
166 if (
const SubRegion *sr = dyn_cast<SubRegion>(superRegion)) {
187 if (isa<VariableArrayType>(T))
209 if (isa<ConstantArrayType>(T))
230 :
DeclRegion(ivd, sReg, ObjCIvarRegionKind) {}
233 return cast<ObjCIvarDecl>(
D);
249 ID.AddInteger((
unsigned)
getKind());
253 ID.AddInteger((
unsigned)
getKind());
258 ID.AddInteger((
unsigned)
getKind());
267 ID.AddPointer(superRegion);
275 ID.AddPointer(superRegion);
279 const Expr *Ex,
unsigned cnt,
284 ID.AddPointer(superRegion);
292 CompoundLiteralRegion::ProfileRegion(ID, CL, superRegion);
295 void CompoundLiteralRegion::ProfileRegion(llvm::FoldingSetNodeID& ID,
300 ID.AddPointer(superRegion);
303 void CXXThisRegion::ProfileRegion(llvm::FoldingSetNodeID &ID,
308 ID.AddPointer(sRegion);
311 void CXXThisRegion::Profile(llvm::FoldingSetNodeID &ID)
const {
312 CXXThisRegion::ProfileRegion(ID, ThisPointerTy, superRegion);
315 void ObjCIvarRegion::ProfileRegion(llvm::FoldingSetNodeID& ID,
323 ID.AddInteger((
unsigned) k);
325 ID.AddPointer(superRegion);
332 void VarRegion::Profile(llvm::FoldingSetNodeID &ID)
const {
333 VarRegion::ProfileRegion(ID,
getDecl(), superRegion);
347 void ElementRegion::ProfileRegion(llvm::FoldingSetNodeID& ID,
352 ID.AddPointer(superRegion);
357 ElementRegion::ProfileRegion(ID, ElementType, Index, superRegion);
391 ID.AddInteger(BlkCount);
399 void CXXTempObjectRegion::ProfileRegion(llvm::FoldingSetNodeID &ID,
410 void CXXBaseObjectRegion::ProfileRegion(llvm::FoldingSetNodeID &ID,
415 ID.AddBoolean(IsVirtual);
427 void GlobalsSpaceRegion::anchor() { }
428 void HeapSpaceRegion::anchor() { }
429 void UnknownSpaceRegion::anchor() { }
430 void StackLocalsSpaceRegion::anchor() { }
431 void StackArgumentsSpaceRegion::anchor() { }
435 void SubRegion::anchor() { }
447 llvm::raw_string_ostream os(s);
453 os <<
"<Unknown Region>";
457 os <<
"alloca{" << (
const void*) Ex <<
',' <<
Cnt <<
'}';
465 os <<
"block_code{" << (
const void*)
this <<
'}';
469 os <<
"block_data{" << BC;
474 os <<
"(" << I.getCapturedRegion() <<
"," <<
475 I.getOriginalRegion() <<
") ";
481 os <<
"{ " << (
const void*) CL <<
" }";
486 << (
const void*) Ex <<
'}';
490 os <<
"base{" << superRegion <<
',' <<
getDecl()->
getName() <<
'}';
498 os <<
"element{" << superRegion <<
','
503 os << superRegion <<
"->" << *
getDecl();
507 os <<
"ivar{" << superRegion <<
',' << *
getDecl() <<
'}';
511 assert(Str !=
nullptr &&
"Expecting non-null StringLiteral");
516 assert(Str !=
nullptr &&
"Expecting non-null ObjCStringLiteral");
521 os <<
"SymRegion{" <<
sym <<
'}';
525 os << *cast<VarDecl>(
D);
537 os <<
"StaticGlobalsMemSpace{" << CR <<
'}';
541 os <<
"GlobalInternalSpaceRegion";
545 os <<
"GlobalSystemSpaceRegion";
549 os <<
"GlobalImmutableSpaceRegion";
553 os <<
"HeapSpaceRegion";
557 os <<
"UnknownSpaceRegion";
561 os <<
"StackArgumentsSpaceRegion";
565 os <<
"StackLocalsSpaceRegion";
577 assert(
canPrintPretty() &&
"This region cannot be printed pretty.");
585 llvm_unreachable(
"This region cannot be printed pretty.");
642 template <
typename REG>
643 const REG *MemRegionManager::LazyAllocate(REG*& region) {
645 region = (REG*) A.Allocate<REG>();
646 new (region) REG(
this);
652 template <
typename REG,
typename ARG>
653 const REG *MemRegionManager::LazyAllocate(REG*& region, ARG a) {
655 region = (REG*) A.Allocate<REG>();
656 new (region) REG(
this, a);
693 return LazyAllocate(SystemGlobals);
695 return LazyAllocate(ImmutableGlobals);
697 return LazyAllocate(InternalGlobals);
711 return LazyAllocate(heap);
715 return LazyAllocate(unknown);
719 return LazyAllocate(code);
737 static llvm::PointerUnion<const StackFrameContext *, const VarRegion *>
743 if (cast<DeclContext>(SFC->getDecl()) == DC)
747 dyn_cast<BlockInvocationContext>(LC)) {
754 if (
const VarRegion *VR = dyn_cast<VarRegion>(I.getOriginalRegion()))
755 if (VR->getDecl() == VD)
756 return cast<VarRegion>(I.getCapturedRegion());
772 if (
C.getSourceManager().isInSystemHeader(D->
getLocation())) {
775 if (D->
getName().find(
"errno") != StringRef::npos)
797 llvm::PointerUnion<const StackFrameContext *, const VarRegion *> V =
809 sReg = isa<ParmVarDecl>(D) || isa<ImplicitParamDecl>(D)
815 const Decl *STCD = STC->getDecl();
816 if (isa<FunctionDecl>(STCD) || isa<ObjCMethodDecl>(STCD))
819 else if (
const BlockDecl *BD = dyn_cast<BlockDecl>(STCD)) {
835 STC->getAnalysisDeclContext());
846 return getSubRegion<VarRegion>(D, sReg);
851 return getSubRegion<VarRegion>(D, superR);
857 unsigned blockCount) {
879 return getSubRegion<BlockDataRegion>(BC, LC, blockCount, sReg);
884 return getSubRegion<CXXTempObjectRegion>(
902 return getSubRegion<CompoundLiteralRegion>(CL, sReg);
912 llvm::FoldingSetNodeID
ID;
913 ElementRegion::ProfileRegion(ID, T, Idx, superRegion);
916 MemRegion* data = Regions.FindNodeOrInsertPos(ID, InsertPos);
922 Regions.InsertNode(R, InsertPos);
930 return getSubRegion<FunctionTextRegion>(FD,
getCodeRegion());
936 return getSubRegion<BlockTextRegion>(BD, locTy, AC,
getCodeRegion());
952 return getSubRegion<FieldRegion>(d, superRegion);
958 return getSubRegion<ObjCIvarRegion>(d, superRegion);
983 for (
const auto &I : Class->
bases()) {
984 if (I.getType()->getAsCXXRecordDecl()->getCanonicalDecl() == BaseClass)
995 if (isa<TypedValueRegion>(Super)) {
1003 dyn_cast<CXXBaseObjectRegion>(Super)) {
1004 Super =
Base->getSuperRegion();
1006 assert(Super && !isa<MemSpaceRegion>(Super));
1010 return getSubRegion<CXXBaseObjectRegion>(RD, IsVirtual, Super);
1057 return isa<StackArgumentsSpaceRegion>(MS) ||
1058 isa<GlobalsSpaceRegion>(MS);
1071 R = cast<SubRegion>(R)->getSuperRegion();
1101 if (!StripBaseCasts)
1103 R = cast<CXXBaseObjectRegion>(R)->getSuperRegion();
1137 int64_t i = CI->getValue().getSExtValue();
1149 offset += (i * size);
1160 assert(superR &&
"super region cannot be NULL");
1171 for (
const auto &I : Child->
bases()) {
1172 if (I.getType()->getAsCXXRecordDecl() == Base)
1181 const MemRegion *SymbolicOffsetBase =
nullptr;
1196 assert(Offset == 0 && !SymbolicOffsetBase);
1205 SymbolicOffsetBase = R;
1210 case CompoundLiteralRegionKind:
1211 case CXXThisRegionKind:
1232 bool RootIsSymbolic =
false;
1234 Ty = TVR->getDesugaredValueType(
getContext());
1235 }
else if (
const SymbolicRegion *SR = dyn_cast<SymbolicRegion>(R)) {
1240 RootIsSymbolic =
true;
1246 SymbolicOffsetBase = R;
1249 if (RootIsSymbolic) {
1255 SymbolicOffsetBase = R;
1258 SymbolicOffsetBase = R;
1264 if (SymbolicOffsetBase)
1285 SymbolicOffsetBase = R;
1294 if (SymbolicOffsetBase)
1297 int64_t i = CI->getValue().getSExtValue();
1302 SymbolicOffsetBase = R;
1317 SymbolicOffsetBase = R;
1322 if (SymbolicOffsetBase)
1328 FE = RD->
field_end(); FI != FE; ++FI, ++idx)
1341 if (SymbolicOffsetBase)
1350 std::pair<const VarRegion *, const VarRegion *>
1351 BlockDataRegion::getCaptureRegions(
const VarDecl *VD) {
1370 return std::make_pair(VR, OriginalVR);
1373 void BlockDataRegion::LazyInitializeReferencedVars() {
1380 std::distance(ReferencedBlockVars.begin(), ReferencedBlockVars.end());
1382 if (NumBlockVars == 0) {
1383 ReferencedVars = (
void*) 0x1;
1392 VarVec *BV = (VarVec*) A.Allocate<VarVec>();
1393 new (BV) VarVec(BC, NumBlockVars);
1394 VarVec *BVOriginal = (VarVec*) A.Allocate<VarVec>();
1395 new (BVOriginal) VarVec(BC, NumBlockVars);
1397 for (
const VarDecl *VD : ReferencedBlockVars) {
1400 std::tie(VR, OriginalVR) = getCaptureRegions(VD);
1403 BV->push_back(VR, BC);
1404 BVOriginal->push_back(OriginalVR, BC);
1407 ReferencedVars = BV;
1408 OriginalVars = BVOriginal;
1418 if (Vec == (
void*) 0x1)
1425 VecOriginal->
begin());
1435 if (Vec == (
void*) 0x1)
1442 VecOriginal->
end());
1449 if (I.getCapturedRegion() == R)
1450 return I.getOriginalRegion();
1461 SymTraitsMap[Sym] |= IK;
1470 MRTraitsMap[MR] |= IK;
1475 const_symbol_iterator I = SymTraitsMap.find(Sym);
1476 if (I != SymTraitsMap.end())
1477 return I->second & IK;
1488 return hasTrait(SR->getSymbol(), IK);
1490 const_region_iterator I = MRTraitsMap.find(MR);
1491 if (I != MRTraitsMap.end())
1492 return I->second & IK;
bool hasStackStorage() const
void Profile(llvm::FoldingSetNodeID &ID) const
bool hasTrait(SymbolRef Sym, InvalidationKinds IK)
void dumpToStream(raw_ostream &os) const override
TypedValueRegion - An abstract class representing regions having a typed value.
void Profile(llvm::FoldingSetNodeID &ID) const override
nonloc::ConcreteInt makeIntVal(const IntegerLiteral *integer)
StringRef getName() const
SymbolManager & getSymbolManager()
MemRegion - The root abstract class for all memory regions.
QualType getArrayIndexType() const
const FieldRegion * getFieldRegion(const FieldDecl *fd, const MemRegion *superRegion)
virtual bool canPrintPretty() const
Returns true if this region can be printed in a user-friendly way.
const CodeTextRegion * getCodeRegion() const
CanQual< T > getUnqualifiedType() const
Retrieve the unqualified form of this type.
const StackFrameContext * getStackFrame() const
Defines the SourceManager interface.
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression...
QuantityType getQuantity() const
getQuantity - Get the raw integer representation of this quantity.
bool hasGlobalsOrParametersStorage() const
virtual QualType getValueType() const =0
void dumpToStream(raw_ostream &os) const override
const StringRegion * getStringRegion(const StringLiteral *Str)
AnalysisDeclContext * getAnalysisDeclContext() const
const GlobalsSpaceRegion * getGlobalsRegion(MemRegion::Kind K=MemRegion::GlobalInternalSpaceRegionKind, const CodeTextRegion *R=nullptr)
std::string getAsString() const
CharUnits getOffset() const
CharUnits getVBaseClassOffset(const CXXRecordDecl *VBase) const
getVBaseClassOffset - Get the offset, in chars, for the given base class.
A container of type source information.
Value representing integer constant.
const StackArgumentsSpaceRegion * getStackArgumentsRegion(const StackFrameContext *STC)
ASTContext & getContext()
QualType getBlockPointerType(QualType T) const
Return the uniqued reference to the type for a block of the specified type.
void printPretty(raw_ostream &os) const override
Print the region for use in diagnostics.
referenced_vars_iterator referenced_vars_begin() const
void Profile(llvm::FoldingSetNodeID &ID) const override
void setTrait(SymbolRef Sym, InvalidationKinds IK)
field_iterator field_begin() const
void Profile(llvm::FoldingSetNodeID &ID) const override
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
QualType getElementType() const
bool hasGlobalStorage() const
Returns true for all variables that do not have local storage.
std::string getString() const
Get a string representation of a region for debug use.
const MemSpaceRegion * getCodeRegion()
const ObjCStringRegion * getObjCStringRegion(const ObjCStringLiteral *Str)
const MemRegion * getBaseRegion() const
static bool isValidBaseClass(const CXXRecordDecl *BaseClass, const TypedValueRegion *Super, bool IsVirtual)
Describes how types, statements, expressions, and declarations should be printed. ...
bool isZeroConstant() const
QualType getFunctionNoProtoType(QualType ResultTy, const FunctionType::ExtInfo &Info) const
Return a K&R style C function type like 'int()'.
referenced_vars_iterator referenced_vars_end() const
Symbolic value. These values used to capture symbolic execution of the program.
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const BlockDecl *BD, CanQualType, const AnalysisDeclContext *, const MemRegion *)
const MemSpaceRegion * getMemorySpace() const
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
const HeapSpaceRegion * getHeapRegion()
The region associated with an ObjCStringLiteral.
void Profile(llvm::FoldingSetNodeID &ID) const override
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
bool isCompleteDefinition() const
const MemRegion * getRegion() const
bool hasStackParametersStorage() const
const BlockDataRegion * getBlockDataRegion(const BlockTextRegion *bc, const LocationContext *lc, unsigned blockCount)
const StackLocalsSpaceRegion * getStackLocalsRegion(const StackFrameContext *STC)
const ObjCIvarRegion * getObjCIvarRegion(const ObjCIvarDecl *ivd, const MemRegion *superRegion)
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.
const FunctionTextRegion * getFunctionTextRegion(const NamedDecl *FD)
const SymbolicRegion * getSymbolicRegion(SymbolRef Sym)
Retrieve or create a "symbolic" memory region.
void Profile(llvm::FoldingSetNodeID &ID) const override
void dumpToStream(raw_ostream &os) const override
const VarDecl * getDecl() const
RegionRawOffset getAsArrayOffset() const
Compute the offset within the array. The array might also be a subobject.
const BlockTextRegion * getBlockTextRegion(const BlockDecl *BD, CanQualType locTy, AnalysisDeclContext *AC)
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. Otherwise, goes up the base chain looking for the f...
const ObjCIvarDecl * getDecl() const
void dumpToStream(raw_ostream &os) const override
const StringLiteral * getStringLiteral() const
QualType getValueType() const override
void Profile(llvm::FoldingSetNodeID &ID) const override
void Profile(llvm::FoldingSetNodeID &ID) const override
void dumpToStream(raw_ostream &os) const override
void Profile(llvm::FoldingSetNodeID &ID) const override
CXXRecordDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
const ASTRecordLayout & getASTRecordLayout(const RecordDecl *D) const
Get or compute information about the layout of the specified record (struct/union/class) D...
void dumpToStream(raw_ostream &os) const override
uint64_t getFieldOffset(unsigned FieldNo) const
void dumpToStream(raw_ostream &os) const override
bool isIncompleteType(NamedDecl **Def=nullptr) const
Def If non-NULL, and the type refers to some kind of declaration that can be completed (such as a C s...
std::string getAsString() const
getNameAsString - Retrieve the human-readable string for this name.
void dumpToStream(raw_ostream &os) const override
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const ObjCStringLiteral *Str, const MemRegion *superRegion)
bool isStaticLocal() const
CharUnits getTypeSizeInChars(QualType T) const
Return the size of the specified (complete) type T, in characters.
Represent a region's offset within the top level base region.
virtual void printPrettyAsExpr(raw_ostream &os) const
Print the region as expression.
FunctionTextRegion - A region that represents code texts of function.
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 CXXBaseObjectRegion * getCXXBaseObjectRegion(const CXXRecordDecl *BaseClass, const MemRegion *Super, bool IsVirtual)
const MemRegion * getSuperRegion() const
field_iterator field_end() const
void dumpToStream(raw_ostream &os) const override
const StackFrameContext * getStackFrame() const
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
const MemRegion * StripCasts(bool StripBaseCasts=true) const
DefinedOrUnknownSVal getExtent(SValBuilder &svalBuilder) const override
getExtent - Returns the size of the region in bytes.
ID
Defines the set of possible language-specific address spaces.
QualType getPointeeType() const
const VarRegion * getOriginalRegion(const VarRegion *VR) const
const MemSpaceRegion * getUnknownRegion()
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
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
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...
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)
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
DeclContext * getDeclContext()
CharUnits getBaseClassOffset(const CXXRecordDecl *Base) const
getBaseClassOffset - Get the offset, in chars, for the given base class.
llvm::BumpPtrAllocator & getAllocator()
void Profile(llvm::FoldingSetNodeID &ID) const override
DeclarationName getDeclName() const
static void ProfileRegion(llvm::FoldingSetNodeID &, const BlockTextRegion *, const LocationContext *, unsigned, const MemRegion *)
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const NamedDecl *FD, const MemRegion *)
The region of the static variables within the current CodeTextRegion scope.
void dumpToStream(raw_ostream &os) const override
QualType getValueType() const override
ASTContext & getContext() const
const StackFrameContext * getCurrentStackFrame() const
virtual void dumpToStream(raw_ostream &os) const
static bool isImmediateBase(const CXXRecordDecl *Child, const CXXRecordDecl *Base)
Returns true if Base is an immediate base class of Child.
const BlockTextRegion * getCodeRegion() const
const FieldDecl * getDecl() const
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
ASTContext & getContext()
void dumpToStream(raw_ostream &os) const override
void printPrettyAsExpr(raw_ostream &os) const override
Print the region as expression.
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)
void Profile(llvm::FoldingSetNodeID &ID) const override
bool isVirtuallyDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is virtually derived from the class Base.
void dumpToStream(raw_ostream &os) const override
const CXXThisRegion * getCXXThisRegion(QualType thisPointerTy, const LocationContext *LC)
RegionOffset getAsOffset() const
Compute the offset within the top level memory object.
const SymbolicRegion * getSymbolicHeapRegion(SymbolRef sym)
Return a unique symbolic region belonging to heap memory space.
const LocationContext * getParent() const
QualType getValueType() const override
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const Expr *Ex, unsigned Cnt, const MemRegion *superRegion)
llvm::iterator_range< referenced_decls_iterator > getReferencedBlockVars(const BlockDecl *BD)
const VarRegion * getVarRegion(const VarDecl *D, const LocationContext *LC)
InvalidationKinds
Describes different invalidation traits.
static void ProfileRegion(llvm::FoldingSetNodeID &ID, const StringLiteral *Str, const MemRegion *superRegion)
Represents symbolic expression.
void Profile(llvm::FoldingSetNodeID &ID) const override
static llvm::PointerUnion< const StackFrameContext *, const VarRegion * > getStackOrCaptureRegionForDeclContext(const LocationContext *LC, const DeclContext *DC, const VarDecl *VD)
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
const CXXTempObjectRegion * getCXXStaticTempObjectRegion(const Expr *Ex)
void dumpToStream(raw_ostream &os) const override
virtual MemRegionManager * getMemRegionManager() const =0
void dumpToStream(raw_ostream &os) const override
CXXRecordDecl * getAsCXXRecordDecl() const
Retrieves the CXXRecordDecl that this type refers to, either because the type is a RecordType or beca...
uint64_t getCharWidth() const
Return the size of the character type, in bits.
MemRegionManager * getMemRegionManager() const override
void Profile(llvm::FoldingSetNodeID &ID) const override
bool canPrintPrettyAsExpr() const override
Returns true if this region's textual representation can be used as part of a larger expression...
const SymbolExtent * getExtentSymbol(const SubRegion *R)
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.
QualType getValueType() const override
void dumpToStream(raw_ostream &os) const override
StringRegion - Region associated with a StringLiteral.
ElementRegin is used to represent both array elements and casts.
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
SourceLocation getLocation() const
const NamedDecl * getDecl() const
bool hasStackNonParametersStorage() const
bool isArithmeticType() const
bool isConstQualified() const
Determine whether this type is const-qualified.
bool isNull() const
isNull - Return true if this QualType doesn't point to a type yet.
void dumpToStream(raw_ostream &os) const override
void dumpToStream(raw_ostream &os) const override
bool hasLocalStorage() const
const RecordDecl * getParent() const
void dumpToStream(raw_ostream &os) const override
void dumpToStream(raw_ostream &os) const override
const BlockDecl * getDecl() const