clang API Documentation

Public Member Functions
clang::ento::MemRegionManager Class Reference

#include <MemRegion.h>

List of all members.

Public Member Functions

 MemRegionManager (ASTContext &c, llvm::BumpPtrAllocator &a)
 ~MemRegionManager ()
ASTContextgetContext ()
llvm::BumpPtrAllocator & getAllocator ()
const StackLocalsSpaceRegiongetStackLocalsRegion (const StackFrameContext *STC)
const StackArgumentsSpaceRegiongetStackArgumentsRegion (const StackFrameContext *STC)
const GlobalsSpaceRegiongetGlobalsRegion (MemRegion::Kind K=MemRegion::GlobalInternalSpaceRegionKind, const CodeTextRegion *R=0)
const HeapSpaceRegiongetHeapRegion ()
const MemSpaceRegiongetUnknownRegion ()
const MemSpaceRegiongetCodeRegion ()
const AllocaRegiongetAllocaRegion (const Expr *Ex, unsigned Cnt, const LocationContext *LC)
 getAllocaRegion - Retrieve a region associated with a call to alloca().
const CompoundLiteralRegiongetCompoundLiteralRegion (const CompoundLiteralExpr *CL, const LocationContext *LC)
const CXXThisRegiongetCXXThisRegion (QualType thisPointerTy, const LocationContext *LC)
const SymbolicRegiongetSymbolicRegion (SymbolRef sym)
 getSymbolicRegion - Retrieve or create a "symbolic" memory region.
const StringRegiongetStringRegion (const StringLiteral *Str)
const ObjCStringRegiongetObjCStringRegion (const ObjCStringLiteral *Str)
const VarRegiongetVarRegion (const VarDecl *D, const LocationContext *LC)
const VarRegiongetVarRegion (const VarDecl *D, const MemRegion *superR)
const ElementRegiongetElementRegion (QualType elementType, NonLoc Idx, const MemRegion *superRegion, ASTContext &Ctx)
const ElementRegiongetElementRegionWithSuper (const ElementRegion *ER, const MemRegion *superRegion)
const FieldRegiongetFieldRegion (const FieldDecl *fd, const MemRegion *superRegion)
const FieldRegiongetFieldRegionWithSuper (const FieldRegion *FR, const MemRegion *superRegion)
const ObjCIvarRegiongetObjCIvarRegion (const ObjCIvarDecl *ivd, const MemRegion *superRegion)
const CXXTempObjectRegiongetCXXTempObjectRegion (Expr const *Ex, LocationContext const *LC)
const CXXBaseObjectRegiongetCXXBaseObjectRegion (const CXXRecordDecl *decl, const MemRegion *superRegion)
const CXXBaseObjectRegiongetCXXBaseObjectRegionWithSuper (const CXXBaseObjectRegion *baseReg, const MemRegion *superRegion)
const FunctionTextRegiongetFunctionTextRegion (const FunctionDecl *FD)
const BlockTextRegiongetBlockTextRegion (const BlockDecl *BD, CanQualType locTy, AnalysisDeclContext *AC)
const BlockDataRegiongetBlockDataRegion (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 *&region)
template<typename REG , typename ARG >
const REG * LazyAllocate (REG *&region, ARG a)

Detailed Description

Definition at line 1050 of file MemRegion.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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 
)
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]
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 
)
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().

template<typename RegionTy , typename A1 >
RegionTy* clang::ento::MemRegionManager::getRegion ( const A1  a1)

Definition at line 36 of file MemRegion.cpp.

template<typename RegionTy , typename A1 , typename A2 >
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().

template<typename RegionTy , typename A1 >
RegionTy* clang::ento::MemRegionManager::getSubRegion ( const A1  a1,
const MemRegion superRegion 
)

Definition at line 57 of file MemRegion.cpp.

template<typename RegionTy , typename A1 , typename A2 >
RegionTy* clang::ento::MemRegionManager::getSubRegion ( const A1  a1,
const A2  a2,
const MemRegion superRegion 
)

Definition at line 96 of file MemRegion.cpp.

template<typename RegionTy , typename A1 , typename A2 , typename A3 >
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)
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 
)
const VarRegion * MemRegionManager::getVarRegion ( const VarDecl D,
const MemRegion superR 
)

getVarRegion - Retrieve or create the memory region associated with a specified VarDecl and super region.

Definition at line 714 of file MemRegion.cpp.

template<typename REG >
const REG* clang::ento::MemRegionManager::LazyAllocate ( REG *&  region)

Definition at line 555 of file MemRegion.cpp.

template<typename REG , typename ARG >
const REG* clang::ento::MemRegionManager::LazyAllocate ( REG *&  region,
ARG  a 
)

Definition at line 565 of file MemRegion.cpp.


The documentation for this class was generated from the following files: