clang API Documentation
#include <MemRegion.h>
Public Member Functions | |
| MemRegionManager (ASTContext &c, llvm::BumpPtrAllocator &a) | |
| ~MemRegionManager () | |
| ASTContext & | getContext () |
| llvm::BumpPtrAllocator & | getAllocator () |
| const StackLocalsSpaceRegion * | getStackLocalsRegion (const StackFrameContext *STC) |
| const StackArgumentsSpaceRegion * | getStackArgumentsRegion (const StackFrameContext *STC) |
| const GlobalsSpaceRegion * | getGlobalsRegion (MemRegion::Kind K=MemRegion::GlobalInternalSpaceRegionKind, const CodeTextRegion *R=0) |
| const HeapSpaceRegion * | getHeapRegion () |
| const MemSpaceRegion * | getUnknownRegion () |
| const MemSpaceRegion * | getCodeRegion () |
| const AllocaRegion * | getAllocaRegion (const Expr *Ex, unsigned Cnt, const LocationContext *LC) |
| getAllocaRegion - Retrieve a region associated with a call to alloca(). | |
| const CompoundLiteralRegion * | getCompoundLiteralRegion (const CompoundLiteralExpr *CL, const LocationContext *LC) |
| const CXXThisRegion * | getCXXThisRegion (QualType thisPointerTy, const LocationContext *LC) |
| const SymbolicRegion * | getSymbolicRegion (SymbolRef sym) |
| getSymbolicRegion - Retrieve or create a "symbolic" memory region. | |
| const StringRegion * | getStringRegion (const StringLiteral *Str) |
| const ObjCStringRegion * | getObjCStringRegion (const ObjCStringLiteral *Str) |
| const VarRegion * | getVarRegion (const VarDecl *D, const LocationContext *LC) |
| const VarRegion * | getVarRegion (const VarDecl *D, const MemRegion *superR) |
| const ElementRegion * | getElementRegion (QualType elementType, NonLoc Idx, const MemRegion *superRegion, ASTContext &Ctx) |
| const ElementRegion * | getElementRegionWithSuper (const ElementRegion *ER, const MemRegion *superRegion) |
| const FieldRegion * | getFieldRegion (const FieldDecl *fd, const MemRegion *superRegion) |
| const FieldRegion * | getFieldRegionWithSuper (const FieldRegion *FR, const MemRegion *superRegion) |
| const ObjCIvarRegion * | getObjCIvarRegion (const ObjCIvarDecl *ivd, const MemRegion *superRegion) |
| const CXXTempObjectRegion * | getCXXTempObjectRegion (Expr const *Ex, LocationContext const *LC) |
| const CXXBaseObjectRegion * | getCXXBaseObjectRegion (const CXXRecordDecl *decl, const MemRegion *superRegion) |
| const CXXBaseObjectRegion * | getCXXBaseObjectRegionWithSuper (const CXXBaseObjectRegion *baseReg, const MemRegion *superRegion) |
| const FunctionTextRegion * | getFunctionTextRegion (const FunctionDecl *FD) |
| const BlockTextRegion * | getBlockTextRegion (const BlockDecl *BD, CanQualType locTy, AnalysisDeclContext *AC) |
| const BlockDataRegion * | getBlockDataRegion (const BlockTextRegion *bc, const LocationContext *lc=NULL) |
| template<typename RegionTy , typename A1 > | |
| RegionTy * | getRegion (const A1 a1) |
| template<typename RegionTy , typename A1 > | |
| RegionTy * | getSubRegion (const A1 a1, const MemRegion *superRegion) |
| template<typename RegionTy , typename A1 , typename A2 > | |
| RegionTy * | getRegion (const A1 a1, const A2 a2) |
| template<typename RegionTy , typename A1 , typename A2 > | |
| RegionTy * | getSubRegion (const A1 a1, const A2 a2, const MemRegion *superRegion) |
| template<typename RegionTy , typename A1 , typename A2 , typename A3 > | |
| RegionTy * | getSubRegion (const A1 a1, const A2 a2, const A3 a3, const MemRegion *superRegion) |
| template<typename REG > | |
| const REG * | LazyAllocate (REG *®ion) |
| template<typename REG , typename ARG > | |
| const REG * | LazyAllocate (REG *®ion, ARG a) |
Definition at line 1050 of file MemRegion.h.
| clang::ento::MemRegionManager::MemRegionManager | ( | ASTContext & | c, |
| llvm::BumpPtrAllocator & | a | ||
| ) | [inline] |
Definition at line 1072 of file MemRegion.h.
| MemRegionManager::~MemRegionManager | ( | ) |
Definition at line 139 of file MemRegion.cpp.
| const AllocaRegion * MemRegionManager::getAllocaRegion | ( | const Expr * | Ex, |
| unsigned | Cnt, | ||
| const LocationContext * | LC | ||
| ) |
getAllocaRegion - Retrieve a region associated with a call to alloca().
Definition at line 840 of file MemRegion.cpp.
References clang::LocationContext::getCurrentStackFrame(), and getStackLocalsRegion().
| llvm::BumpPtrAllocator& clang::ento::MemRegionManager::getAllocator | ( | ) | [inline] |
Definition at line 1080 of file MemRegion.h.
| const BlockDataRegion * MemRegionManager::getBlockDataRegion | ( | const BlockTextRegion * | bc, |
| const LocationContext * | lc = NULL |
||
| ) |
getBlockDataRegion - Get the memory region associated with an instance of a block. Unlike many other MemRegions, the LocationContext* argument is allowed to be NULL for cases where we have no known context.
Definition at line 720 of file MemRegion.cpp.
References clang::LocationContext::getCurrentStackFrame(), clang::ento::BlockTextRegion::getDecl(), getGlobalsRegion(), getStackLocalsRegion(), getUnknownRegion(), clang::ento::MemRegion::GlobalImmutableSpaceRegionKind, and clang::BlockDecl::hasCaptures().
Referenced by clang::ento::SValBuilder::getBlockPointer().
| const BlockTextRegion * MemRegionManager::getBlockTextRegion | ( | const BlockDecl * | BD, |
| CanQualType | locTy, | ||
| AnalysisDeclContext * | AC | ||
| ) |
Definition at line 792 of file MemRegion.cpp.
References getCodeRegion().
Referenced by clang::ento::SValBuilder::getBlockPointer(), and getVarRegion().
| const MemSpaceRegion * MemRegionManager::getCodeRegion | ( | ) |
Definition at line 630 of file MemRegion.cpp.
Referenced by getBlockTextRegion(), and getFunctionTextRegion().
| const CompoundLiteralRegion * MemRegionManager::getCompoundLiteralRegion | ( | const CompoundLiteralExpr * | CL, |
| const LocationContext * | LC | ||
| ) |
getCompoundLiteralRegion - Retrieve the region associated with a given CompoundLiteral.
Definition at line 747 of file MemRegion.cpp.
References clang::LocationContext::getCurrentStackFrame(), getGlobalsRegion(), getStackLocalsRegion(), and clang::CompoundLiteralExpr::isFileScope().
Referenced by clang::ento::StoreManager::getLValueCompoundLiteral().
| ASTContext& clang::ento::MemRegionManager::getContext | ( | ) | [inline] |
Definition at line 1078 of file MemRegion.h.
Referenced by clang::ento::MemRegion::getContext().
| const CXXBaseObjectRegion * MemRegionManager::getCXXBaseObjectRegion | ( | const CXXRecordDecl * | decl, |
| const MemRegion * | superRegion | ||
| ) |
Definition at line 824 of file MemRegion.cpp.
Referenced by getCXXBaseObjectRegionWithSuper().
| const CXXBaseObjectRegion* clang::ento::MemRegionManager::getCXXBaseObjectRegionWithSuper | ( | const CXXBaseObjectRegion * | baseReg, |
| const MemRegion * | superRegion | ||
| ) | [inline] |
Create a CXXBaseObjectRegion with the same CXXRecordDecl but a different super region.
Definition at line 1178 of file MemRegion.h.
References getCXXBaseObjectRegion(), and clang::ento::CXXBaseObjectRegion::getDecl().
| const CXXTempObjectRegion * MemRegionManager::getCXXTempObjectRegion | ( | Expr const * | Ex, |
| LocationContext const * | LC | ||
| ) |
Definition at line 816 of file MemRegion.cpp.
References clang::LocationContext::getCurrentStackFrame(), and getStackLocalsRegion().
Referenced by clang::ento::ExprEngine::CreateCXXTemporaryObject(), and clang::ento::ExprEngine::VisitCXXConstructExpr().
| const CXXThisRegion * MemRegionManager::getCXXThisRegion | ( | QualType | thisPointerTy, |
| const LocationContext * | LC | ||
| ) |
getCXXThisRegion - Retrieve the [artificial] region associated with the parameter 'this'.
Definition at line 830 of file MemRegion.cpp.
References clang::LocationContext::getCurrentStackFrame(), and getStackArgumentsRegion().
Referenced by clang::ento::ExprEngine::VisitCXXThisExpr().
| const ElementRegion * MemRegionManager::getElementRegion | ( | QualType | elementType, |
| NonLoc | Idx, | ||
| const MemRegion * | superRegion, | ||
| ASTContext & | Ctx | ||
| ) |
getElementRegion - Retrieve the memory region associated with the associated element type, index, and super region.
Definition at line 764 of file MemRegion.cpp.
References data(), clang::ASTContext::getCanonicalType(), and clang::CanQual< T >::getUnqualifiedType().
Referenced by getElementRegionWithSuper(), clang::ento::StoreManager::GetElementZeroRegion(), clang::ento::StoreManager::getLValueElement(), and clang::ento::StoreManager::MakeElementRegion().
| const ElementRegion* clang::ento::MemRegionManager::getElementRegionWithSuper | ( | const ElementRegion * | ER, |
| const MemRegion * | superRegion | ||
| ) | [inline] |
Definition at line 1144 of file MemRegion.h.
References clang::ento::MemRegion::getContext(), getElementRegion(), clang::ento::ElementRegion::getElementType(), and clang::ento::ElementRegion::getIndex().
| const FieldRegion * MemRegionManager::getFieldRegion | ( | const FieldDecl * | fd, |
| const MemRegion * | superRegion | ||
| ) |
getFieldRegion - Retrieve or create the memory region associated with a specified FieldDecl. 'superRegion' corresponds to the containing memory region (which typically represents the memory representing a structure or class).
Definition at line 804 of file MemRegion.cpp.
Referenced by getFieldRegionWithSuper().
| const FieldRegion* clang::ento::MemRegionManager::getFieldRegionWithSuper | ( | const FieldRegion * | FR, |
| const MemRegion * | superRegion | ||
| ) | [inline] |
Definition at line 1157 of file MemRegion.h.
References clang::ento::FieldRegion::getDecl(), and getFieldRegion().
| const FunctionTextRegion * MemRegionManager::getFunctionTextRegion | ( | const FunctionDecl * | FD | ) |
Definition at line 787 of file MemRegion.cpp.
References getCodeRegion().
Referenced by clang::ento::SValBuilder::getFunctionPointer(), and getVarRegion().
| const GlobalsSpaceRegion * MemRegionManager::getGlobalsRegion | ( | MemRegion::Kind | K = MemRegion::GlobalInternalSpaceRegionKind, |
| const CodeTextRegion * | R = 0 |
||
| ) |
getGlobalsRegion - Retrieve the memory region associated with global variables.
Definition at line 601 of file MemRegion.cpp.
References clang::ento::MemRegion::GlobalImmutableSpaceRegionKind, clang::ento::MemRegion::GlobalInternalSpaceRegionKind, clang::ento::MemRegion::GlobalSystemSpaceRegionKind, and clang::ento::MemRegion::StaticGlobalSpaceRegionKind.
Referenced by getBlockDataRegion(), getCompoundLiteralRegion(), getObjCStringRegion(), getStringRegion(), and getVarRegion().
| const HeapSpaceRegion * MemRegionManager::getHeapRegion | ( | ) |
getHeapRegion - Retrieve the memory region associated with the generic "heap".
Definition at line 622 of file MemRegion.cpp.
| const ObjCIvarRegion * MemRegionManager::getObjCIvarRegion | ( | const ObjCIvarDecl * | ivd, |
| const MemRegion * | superRegion | ||
| ) |
getObjCIvarRegion - Retrieve or create the memory region associated with a specified Objective-c instance variable. 'superRegion' corresponds to the containing region (which typically represents the Objective-C object).
Definition at line 810 of file MemRegion.cpp.
| const ObjCStringRegion * MemRegionManager::getObjCStringRegion | ( | const ObjCStringLiteral * | Str | ) |
Definition at line 642 of file MemRegion.cpp.
References getGlobalsRegion().
| RegionTy* clang::ento::MemRegionManager::getRegion | ( | const A1 | a1 | ) |
Definition at line 36 of file MemRegion.cpp.
| const TypedRegion * nonloc::LazyCompoundVal::getRegion | ( | const A1 | a1, |
| const A2 | a2 | ||
| ) |
Definition at line 75 of file MemRegion.cpp.
| const StackArgumentsSpaceRegion * MemRegionManager::getStackArgumentsRegion | ( | const StackFrameContext * | STC | ) |
getStackArgumentsRegion - Retrieve the memory region associated with function/method arguments of the specified stack frame.
Definition at line 588 of file MemRegion.cpp.
Referenced by getCXXThisRegion(), and getVarRegion().
| const StackLocalsSpaceRegion * MemRegionManager::getStackLocalsRegion | ( | const StackFrameContext * | STC | ) |
getStackLocalsRegion - Retrieve the memory region associated with the specified stack frame.
Definition at line 575 of file MemRegion.cpp.
Referenced by getAllocaRegion(), getBlockDataRegion(), getCompoundLiteralRegion(), getCXXTempObjectRegion(), and getVarRegion().
| const StringRegion * MemRegionManager::getStringRegion | ( | const StringLiteral * | Str | ) |
Definition at line 637 of file MemRegion.cpp.
References getGlobalsRegion().
| RegionTy* clang::ento::MemRegionManager::getSubRegion | ( | const A1 | a1, |
| const MemRegion * | superRegion | ||
| ) |
Definition at line 57 of file MemRegion.cpp.
| RegionTy* clang::ento::MemRegionManager::getSubRegion | ( | const A1 | a1, |
| const A2 | a2, | ||
| const MemRegion * | superRegion | ||
| ) |
Definition at line 96 of file MemRegion.cpp.
| RegionTy* clang::ento::MemRegionManager::getSubRegion | ( | const A1 | a1, |
| const A2 | a2, | ||
| const A3 | a3, | ||
| const MemRegion * | superRegion | ||
| ) |
Definition at line 115 of file MemRegion.cpp.
| const SymbolicRegion * MemRegionManager::getSymbolicRegion | ( | SymbolRef | sym | ) |
getSymbolicRegion - Retrieve or create a "symbolic" memory region.
Definition at line 799 of file MemRegion.cpp.
References getUnknownRegion().
Referenced by clang::ento::SValBuilder::getConjuredSymbolVal(), clang::ento::SValBuilder::getDerivedRegionValueSymbolVal(), clang::ento::SValBuilder::getMetadataSymbolVal(), clang::ento::SValBuilder::getRegionValueSymbolVal(), and clang::ento::SValBuilder::makeLoc().
| const MemSpaceRegion * MemRegionManager::getUnknownRegion | ( | ) |
getUnknownRegion - Retrieve the memory region associated with unknown memory space.
Definition at line 626 of file MemRegion.cpp.
Referenced by getBlockDataRegion(), getSymbolicRegion(), and getVarRegion().
| const VarRegion * MemRegionManager::getVarRegion | ( | const VarDecl * | D, |
| const LocationContext * | LC | ||
| ) |
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and LocationContext.
Definition at line 646 of file MemRegion.cpp.
References clang::LocationContext::getAnalysisDeclContext(), getBlockTextRegion(), clang::LocationContext::getDecl(), clang::Decl::getDeclContext(), getFunctionTextRegion(), getGlobalsRegion(), clang::Decl::getLocation(), clang::NamedDecl::getName(), clang::BlockDecl::getSignatureAsWritten(), getStackArgumentsRegion(), clang::LocationContext::getStackFrameForDeclContext(), getStackLocalsRegion(), clang::TypeSourceInfo::getType(), clang::ValueDecl::getType(), clang::QualType::getTypePtrOrNull(), getUnknownRegion(), clang::ento::MemRegion::GlobalImmutableSpaceRegionKind, clang::ento::MemRegion::GlobalSystemSpaceRegionKind, clang::VarDecl::hasGlobalStorage(), clang::VarDecl::hasLocalStorage(), clang::Type::isArithmeticType(), clang::QualType::isConstQualified(), clang::VarDecl::isStaticLocal(), and clang::ento::MemRegion::StaticGlobalSpaceRegionKind.
Referenced by clang::ento::StoreManager::getLValueVar(), clang::ento::ProgramState::getRegion(), and clang::ento::FindLastStoreBRVisitor::registerStatementVarDecls().
getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and super region.
Definition at line 714 of file MemRegion.cpp.
| const REG* clang::ento::MemRegionManager::LazyAllocate | ( | REG *& | region | ) |
Definition at line 555 of file MemRegion.cpp.
| const REG* clang::ento::MemRegionManager::LazyAllocate | ( | REG *& | region, |
| ARG | a | ||
| ) |
Definition at line 565 of file MemRegion.cpp.