clang 22.0.0git
clang::ento::nonloc::PointerToMember Class Reference

Value representing pointer-to-member. More...

#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"

Inheritance diagram for clang::ento::nonloc::PointerToMember:
[legend]

Public Types

using PTMDataType
using iterator = llvm::ImmutableList<const CXXBaseSpecifier *>::iterator
Public Types inherited from clang::ento::SVal
enum  SValKind : unsigned char

Public Member Functions

const PTMDataType getPTMData () const
bool isNullMemberPointer () const
const NamedDeclgetDecl () const
template<typename AdjustedDecl>
const AdjustedDecl * getDeclAs () const
iterator begin () const
iterator end () const
Public Member Functions inherited from clang::ento::NonLoc
void dumpToStream (raw_ostream &Out) const
Public Member Functions inherited from clang::ento::DefinedSVal
bool isUnknown () const =delete
bool isUnknownOrUndef () const =delete
bool isValid () const =delete
Public Member Functions inherited from clang::ento::DefinedOrUnknownSVal
bool isUndef () const =delete
bool isValid () const =delete
Public Member Functions inherited from clang::ento::SVal
 SVal ()=default
template<typename T>
T castAs () const
 Convert to the specified SVal type, asserting that this SVal is of the desired type.
template<typename T>
std::optional< TgetAs () const
 Convert to the specified SVal type, returning std::nullopt if this SVal is not of the desired type.
SValKind getKind () const
StringRef getKindStr () const
void Profile (llvm::FoldingSetNodeID &ID) const
bool operator== (SVal R) const
bool operator!= (SVal R) const
bool isUnknown () const
bool isUndef () const
bool isUnknownOrUndef () const
bool isValid () const
bool isConstant () const
bool isConstant (int I) const
bool isZeroConstant () const
const FunctionDeclgetAsFunctionDecl () const
 getAsFunctionDecl - If this SVal is a MemRegionVal and wraps a CodeTextRegion wrapping a FunctionDecl, return that FunctionDecl.
SymbolRef getAsLocSymbol (bool IncludeBaseRegions=false) const
 If this SVal is a location and wraps a symbol, return that SymbolRef.
SymbolRef getLocSymbolInBase () const
 Get the symbol in the SVal or its base region.
SymbolRef getAsSymbol (bool IncludeBaseRegions=false) const
 If this SVal wraps a symbol return that SymbolRef.
const llvm::APSInt * getAsInteger () const
 If this SVal is loc::ConcreteInt or nonloc::ConcreteInt, return a pointer to APSInt which is held in it.
const MemRegiongetAsRegion () const
void printJson (raw_ostream &Out, bool AddQuotes) const
 printJson - Pretty-prints in JSON format.
void dumpToStream (raw_ostream &OS) const
void dump () const
llvm::iterator_range< SymExpr::symbol_iteratorsymbols () const
QualType getType (const ASTContext &) const
 Try to get a reasonable type for the given value.

Static Public Member Functions

static bool classof (SVal V)
Static Public Member Functions inherited from clang::ento::NonLoc
static bool isCompoundType (QualType T)
static bool classof (SVal V)
Static Public Member Functions inherited from clang::ento::DefinedSVal
static bool classof (SVal V)
Static Public Member Functions inherited from clang::ento::DefinedOrUnknownSVal
static bool classof (SVal V)

Friends

class ento::SValBuilder

Additional Inherited Members

Protected Member Functions inherited from clang::ento::NonLoc
 NonLoc (SValKind Kind, const void *Data)
Protected Member Functions inherited from clang::ento::DefinedSVal
 DefinedSVal (SValKind Kind, const void *Data)
Protected Member Functions inherited from clang::ento::DefinedOrUnknownSVal
 DefinedOrUnknownSVal (SValKind Kind, const void *Data=nullptr)
Protected Member Functions inherited from clang::ento::SVal
 SVal (SValKind Kind, const void *Data=nullptr)
template<typename T>
const TcastDataAs () const
Protected Attributes inherited from clang::ento::SVal
const void * Data = nullptr
SValKind Kind = UndefinedValKind

Detailed Description

Value representing pointer-to-member.

This value is qualified as NonLoc because neither loading nor storing operations are applied to it. Instead, the analyzer uses the L-value coming from pointer-to-member applied to an object. This SVal is represented by a NamedDecl which can be a member function pointer or a member data pointer and an optional list of CXXBaseSpecifiers. This list is required to accumulate the pointer-to-member cast history to figure out the correct subobject field. In particular, implicit casts grow this list and explicit casts like static_cast shrink this list.

Definition at line 434 of file SVals.h.

Member Typedef Documentation

◆ iterator

using clang::ento::nonloc::PointerToMember::iterator = llvm::ImmutableList<const CXXBaseSpecifier *>::iterator

Definition at line 454 of file SVals.h.

◆ PTMDataType

Initial value:
llvm::PointerUnion<const NamedDecl *, const PointerToMemberData *>

Definition at line 438 of file SVals.h.

Member Function Documentation

◆ begin()

nonloc::PointerToMember::iterator nonloc::PointerToMember::begin ( ) const

Definition at line 227 of file SVals.cpp.

References clang::cast(), getPTMData(), and clang::isa().

◆ classof()

bool clang::ento::nonloc::PointerToMember::classof ( SVal V)
inlinestatic

Definition at line 459 of file SVals.h.

References V.

◆ end()

nonloc::PointerToMember::iterator nonloc::PointerToMember::end ( ) const

Definition at line 234 of file SVals.cpp.

References clang::cast(), getPTMData(), and clang::isa().

◆ getDecl()

const NamedDecl * nonloc::PointerToMember::getDecl ( ) const

Definition at line 201 of file SVals.cpp.

References clang::cast(), and getPTMData().

Referenced by clang::ento::NonLoc::dumpToStream(), and getDeclAs().

◆ getDeclAs()

template<typename AdjustedDecl>
const AdjustedDecl * clang::ento::nonloc::PointerToMember::getDeclAs ( ) const
inline

Definition at line 450 of file SVals.h.

References getDecl().

◆ getPTMData()

const PTMDataType clang::ento::nonloc::PointerToMember::getPTMData ( ) const
inline

◆ isNullMemberPointer()

bool nonloc::PointerToMember::isNullMemberPointer ( ) const

Definition at line 197 of file SVals.cpp.

References getPTMData().

◆ ento::SValBuilder

friend class ento::SValBuilder
friend

Definition at line 435 of file SVals.h.


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