clang: clang::ento::MemRegion Class Reference (original) (raw)
MemRegion - The root abstract class for all memory regions. More...
#include "[clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h](MemRegion%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
ASTContext & | getContext () const |
virtual void | Profile (llvm::FoldingSetNodeID &ID) const =0 |
virtual MemRegionManager & | getMemRegionManager () const =0 |
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemSpaceRegion * | getMemorySpace () const |
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * | getBaseRegion () const |
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * | getMostDerivedObjectRegion () const |
Recursively retrieve the region of the most derived class instance of regions of C++ base class instances. | |
virtual bool | isSubRegionOf (const MemRegion *R) const |
Check if the region is a subregion of the given region. | |
LLVM_ATTRIBUTE_RETURNS_NONNULL const MemRegion * | StripCasts (bool StripBaseAndDerivedCasts=true) const |
const SymbolicRegion * | getSymbolicBase () const |
If this is a symbolic region, returns the region. | |
bool | hasStackStorage () const |
bool | hasStackNonParametersStorage () const |
bool | hasStackParametersStorage () const |
RegionOffset | getAsOffset () const |
Compute the offset within the top level memory object. | |
std::string | getString () const |
Get a string representation of a region for debug use. | |
virtual void | dumpToStream (raw_ostream &os) const |
void | dump () const |
virtual bool | canPrintPretty () const |
Returns true if this region can be printed in a user-friendly way. | |
virtual void | printPretty (raw_ostream &os) const |
Print the region for use in diagnostics. | |
virtual bool | canPrintPrettyAsExpr () const |
Returns true if this region's textual representation can be used as part of a larger expression. | |
virtual void | printPrettyAsExpr (raw_ostream &os) const |
Print the region as expression. | |
Kind | getKind () const |
StringRef | getKindStr () const |
template | |
const RegionTy * | getAs () const |
template | |
LLVM_ATTRIBUTE_RETURNS_NONNULL const RegionTy * | castAs () const |
virtual bool | isBoundable () const |
std::string | getDescriptiveName (bool UseQuotes=true) const |
Get descriptive name for memory region. | |
SourceRange | sourceRange () const |
Retrieve source range from memory region. | |
MemRegion - The root abstract class for all memory regions.
Definition at line 97 of file MemRegion.h.
◆ Kind
clang::ento::MemRegion::MemRegion ( Kind k) | inlineprotected |
---|
◆ ~MemRegion()
MemRegion::~MemRegion ( ) | protectedvirtualdefault |
---|
◆ canPrintPretty()
bool MemRegion::canPrintPretty ( ) const | virtual |
---|
◆ canPrintPrettyAsExpr()
bool MemRegion::canPrintPrettyAsExpr ( ) const | virtual |
---|
◆ castAs()
template
LLVM_ATTRIBUTE_RETURNS_NONNULL const RegionTy * clang::ento::MemRegion::castAs
◆ dump()
LLVM_DUMP_METHOD void MemRegion::dump | ( | ) | const |
---|
◆ dumpToStream()
void MemRegion::dumpToStream ( raw_ostream & os) const | virtual |
---|
Reimplemented in clang::ento::CodeSpaceRegion, clang::ento::StaticGlobalSpaceRegion, clang::ento::GlobalSystemSpaceRegion, clang::ento::GlobalImmutableSpaceRegion, clang::ento::GlobalInternalSpaceRegion, clang::ento::HeapSpaceRegion, clang::ento::UnknownSpaceRegion, clang::ento::StackLocalsSpaceRegion, clang::ento::StackArgumentsSpaceRegion, clang::ento::AllocaRegion, clang::ento::FunctionCodeRegion, clang::ento::BlockCodeRegion, clang::ento::BlockDataRegion, clang::ento::SymbolicRegion, clang::ento::StringRegion, clang::ento::ObjCStringRegion, clang::ento::CompoundLiteralRegion, clang::ento::NonParamVarRegion, clang::ento::ParamVarRegion, clang::ento::CXXThisRegion, clang::ento::FieldRegion, clang::ento::ObjCIvarRegion, clang::ento::ElementRegion, clang::ento::CXXTempObjectRegion, clang::ento::CXXLifetimeExtendedObjectRegion, clang::ento::CXXBaseObjectRegion, and clang::ento::CXXDerivedObjectRegion.
Definition at line 484 of file MemRegion.cpp.
Referenced by dump(), getString(), and clang::ento::operator<<().
◆ getAs()
template
const RegionTy * clang::ento::MemRegion::getAs
Definition at line 1388 of file MemRegion.h.
Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkRegionChanges(), computeOffset(), dereference(), clang::ento::SVal::getAsFunctionDecl(), getConstructedRegion(), getDescriptiveName(), getExceedsMsgs(), getRegionName(), getStackOrGlobalSpaceRegion(), isInvalidatedSymbolRegion(), and parameterTypeFromSVal().
◆ getAsOffset()
◆ getBaseRegion()
const MemRegion * MemRegion::getBaseRegion | ( | ) | const |
---|
Definition at line 1377 of file MemRegion.cpp.
References getKind().
Referenced by clang::ento::taint::addPartialTaint(), getExistingLazyBinding(), clang::ento::CXXInstanceCall::getExtraInvalidatedValues(), clang::ento::PathSensitiveBugReport::getInterestingnessKind(), getOriginBaseRegion(), getStackOrGlobalSpaceRegion(), clang::ento::SymbolReaper::isLiveRegion(), clang::ento::PathSensitiveBugReport::markInteresting(), clang::ento::SymbolReaper::markLazilyCopied(), clang::ento::SymbolReaper::markLive(), clang::ento::PathSensitiveBugReport::markNotInteresting(), printReferrer(), clang::ento::ExprEngine::ProcessAutomaticObjDtor(), clang::ento::ExprEngine::processPointerEscapedOnBind(), clang::ento::ScanReachableSymbols::scan(), and sourceRange().
◆ getContext()
ASTContext & clang::ento::MemRegion::getContext ( ) const | inline |
---|
Definition at line 1620 of file MemRegion.h.
References clang::ento::MemRegionManager::getContext(), and getMemRegionManager().
Referenced by calculateOffset(), clang::ento::AllocaRegion::dumpToStream(), clang::ento::StringRegion::dumpToStream(), clang::ento::ObjCStringRegion::dumpToStream(), clang::ento::CompoundLiteralRegion::dumpToStream(), clang::ento::CXXTempObjectRegion::dumpToStream(), clang::ento::CXXLifetimeExtendedObjectRegion::dumpToStream(), clang::ento::ElementRegion::getAsArrayOffset(), clang::ento::MemRegionManager::getElementRegionWithSuper(), clang::ento::TypedValueRegion::getLocationType(), and clang::ento::FunctionCodeRegion::getLocationType().
◆ getDescriptiveName()
std::string MemRegion::getDescriptiveName | ( | bool | UseQuotes = true | ) | const |
---|
Get descriptive name for memory region.
The name is obtained from the variable/field declaration retrieved from the memory region. Regions that point to an element of an array are returned as: "arr[0]". Regions that point to a struct are returned as: "st.var".
Parameters
UseQuotes | Set if the name should be quoted. |
---|
Returns
variable name for memory region
Definition at line 726 of file MemRegion.cpp.
References canPrintPrettyAsExpr(), getAs(), clang::ento::SVal::getAs(), getDescriptiveName(), clang::ento::ElementRegion::getIndex(), clang::ento::SubRegion::getSuperRegion(), and printPrettyAsExpr().
Referenced by getDescriptiveName(), getRegionName(), clang::ento::mpi::MPIBugReporter::reportDoubleNonblocking(), clang::ento::mpi::MPIBugReporter::reportMissingWait(), and clang::ento::mpi::MPIBugReporter::reportUnmatchedWait().
◆ getKind()
Kind clang::ento::MemRegion::getKind ( ) const | inline |
---|
Definition at line 175 of file MemRegion.h.
Referenced by calculateOffset(), clang::ento::StoreManager::castRegion(), clang::ento::MemSpaceRegion::classof(), clang::ento::CodeSpaceRegion::classof(), clang::ento::GlobalsSpaceRegion::classof(), clang::ento::StaticGlobalSpaceRegion::classof(), clang::ento::NonStaticGlobalSpaceRegion::classof(), clang::ento::GlobalSystemSpaceRegion::classof(), clang::ento::GlobalImmutableSpaceRegion::classof(), clang::ento::GlobalInternalSpaceRegion::classof(), clang::ento::HeapSpaceRegion::classof(), clang::ento::UnknownSpaceRegion::classof(), clang::ento::StackSpaceRegion::classof(), clang::ento::StackLocalsSpaceRegion::classof(), clang::ento::StackArgumentsSpaceRegion::classof(), clang::ento::SubRegion::classof(), clang::ento::AllocaRegion::classof(), clang::ento::TypedRegion::classof(), clang::ento::TypedValueRegion::classof(), clang::ento::CodeTextRegion::classof(), clang::ento::FunctionCodeRegion::classof(), clang::ento::BlockCodeRegion::classof(), clang::ento::BlockDataRegion::classof(), clang::ento::SymbolicRegion::classof(), clang::ento::StringRegion::classof(), clang::ento::ObjCStringRegion::classof(), clang::ento::CompoundLiteralRegion::classof(), clang::ento::DeclRegion::classof(), clang::ento::VarRegion::classof(), clang::ento::NonParamVarRegion::classof(), clang::ento::ParamVarRegion::classof(), clang::ento::CXXThisRegion::classof(), clang::ento::FieldRegion::classof(), clang::ento::ObjCIvarRegion::classof(), clang::ento::ElementRegion::classof(), clang::ento::CXXTempObjectRegion::classof(), clang::ento::CXXLifetimeExtendedObjectRegion::classof(), clang::ento::CXXBaseObjectRegion::classof(), clang::ento::CXXDerivedObjectRegion::classof(), getBaseRegion(), getKindStr(), clang::ento::MemSpaceRegion::Profile(), clang::ento::StaticGlobalSpaceRegion::Profile(), clang::ento::StackSpaceRegion::Profile(), StripCasts(), and clang::ento::MemRegionVisitor< ImplClass, RetTy >::Visit().
◆ getKindStr()
StringRef MemRegion::getKindStr | ( | ) | const |
---|
◆ getMemorySpace()
Definition at line 1351 of file MemRegion.cpp.
Referenced by GetAllocationSite(), getRegionName(), clang::ento::VarRegion::getStackFrame(), clang::ento::CXXTempObjectRegion::getStackFrame(), clang::ento::CXXLifetimeExtendedObjectRegion::getStackFrame(), getStackOrGlobalSpaceRegion(), hasStackNonParametersStorage(), hasStackParametersStorage(), hasStackStorage(), isInitializationOfVar(), clang::ento::ExprEngine::processPointerEscapedOnBind(), and clang::ento::SValExplainer::VisitSymbolicRegion().
◆ getMemRegionManager()
virtual MemRegionManager & clang::ento::MemRegion::getMemRegionManager ( ) const | pure virtual |
---|
◆ getMostDerivedObjectRegion()
const MemRegion * MemRegion::getMostDerivedObjectRegion | ( | ) | const |
---|
Recursively retrieve the region of the most derived class instance of regions of C++ base class instances.
Definition at line 1397 of file MemRegion.cpp.
◆ getString()
std::string MemRegion::getString | ( | ) | const |
---|
◆ getSymbolicBase()
◆ hasStackNonParametersStorage()
bool MemRegion::hasStackNonParametersStorage | ( | ) | const |
---|
◆ hasStackParametersStorage()
bool MemRegion::hasStackParametersStorage | ( | ) | const |
---|
◆ hasStackStorage()
bool MemRegion::hasStackStorage | ( | ) | const |
---|
◆ isBoundable()
virtual bool clang::ento::MemRegion::isBoundable ( ) const | inlinevirtual |
---|
◆ isSubRegionOf()
bool MemRegion::isSubRegionOf ( const MemRegion * R) const | virtual |
---|
◆ printPretty()
void MemRegion::printPretty ( raw_ostream & os) const | virtual |
---|
◆ printPrettyAsExpr()
void MemRegion::printPrettyAsExpr ( raw_ostream & os) const | virtual |
---|
Print the region as expression.
When this region represents a subexpression, the method is for printing an expression containing it.
Reimplemented in clang::ento::NonParamVarRegion, clang::ento::ParamVarRegion, clang::ento::FieldRegion, clang::ento::ObjCIvarRegion, clang::ento::CXXBaseObjectRegion, and clang::ento::CXXDerivedObjectRegion.
Definition at line 659 of file MemRegion.cpp.
Referenced by getDescriptiveName(), printPretty(), clang::ento::FieldRegion::printPrettyAsExpr(), clang::ento::CXXBaseObjectRegion::printPrettyAsExpr(), and clang::ento::CXXDerivedObjectRegion::printPrettyAsExpr().
◆ Profile()
virtual void clang::ento::MemRegion::Profile ( llvm::FoldingSetNodeID & ID) const | pure virtual |
---|
Implemented in clang::ento::MemSpaceRegion, clang::ento::StaticGlobalSpaceRegion, clang::ento::StackSpaceRegion, clang::ento::AllocaRegion, clang::ento::FunctionCodeRegion, clang::ento::BlockCodeRegion, clang::ento::BlockDataRegion, clang::ento::SymbolicRegion, clang::ento::StringRegion, clang::ento::ObjCStringRegion, clang::ento::CompoundLiteralRegion, clang::ento::NonParamVarRegion, clang::ento::ParamVarRegion, clang::ento::CXXThisRegion, clang::ento::FieldRegion, clang::ento::ObjCIvarRegion, clang::ento::ElementRegion, clang::ento::CXXTempObjectRegion, clang::ento::CXXLifetimeExtendedObjectRegion, clang::ento::CXXBaseObjectRegion, and clang::ento::CXXDerivedObjectRegion.
◆ sourceRange()
◆ StripCasts()
const MemRegion * MemRegion::StripCasts | ( | bool | StripBaseAndDerivedCasts = true | ) | const |
---|
The documentation for this class was generated from the following files:
- include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
- lib/StaticAnalyzer/Core/MemRegion.cpp