clang 20.0.0git
Classes | Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
clang::ento::SymExpr Class Referenceabstract

Symbolic value. More...

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

Inheritance diagram for clang::ento::SymExpr:
Inheritance graph
[legend]

Classes

class  symbol_iterator
 Iterator over symbols that the current symbol depends on. More...
 

Public Types

enum  Kind
 

Public Member Functions

virtual ~SymExpr ()=default
 
Kind getKind () const
 
SymbolID getSymbolID () const
 Get a unique identifier for this symbol.
 
virtual void dump () const
 
virtual void dumpToStream (raw_ostream &os) const
 
virtual QualType getType () const =0
 
virtual void Profile (llvm::FoldingSetNodeID &profile)=0
 
llvm::iterator_range< symbol_iteratorsymbols () const
 
virtual unsigned computeComplexity () const =0
 
virtual const MemRegiongetOriginRegion () const
 Find the region from which this symbol originates.
 

Protected Member Functions

 SymExpr (Kind k, SymbolID Sym)
 

Static Protected Member Functions

static bool isValidTypeForSymbol (QualType T)
 

Protected Attributes

unsigned Complexity = 0
 

Detailed Description

Symbolic value.

These values used to capture symbolic execution of the program.

Definition at line 32 of file SymExpr.h.

Member Enumeration Documentation

◆ Kind

Definition at line 36 of file SymExpr.h.

Constructor & Destructor Documentation

◆ SymExpr()

clang::ento::SymExpr::SymExpr ( Kind  k,
SymbolID  Sym 
)
inlineprotected

Definition at line 56 of file SymExpr.h.

◆ ~SymExpr()

virtual clang::ento::SymExpr::~SymExpr ( )
virtualdefault

Member Function Documentation

◆ computeComplexity()

virtual unsigned clang::ento::SymExpr::computeComplexity ( ) const
pure virtual

◆ dump()

LLVM_DUMP_METHOD void SymExpr::dump ( ) const
virtual

Definition at line 44 of file SymbolManager.cpp.

References dumpToStream().

◆ dumpToStream()

virtual void clang::ento::SymExpr::dumpToStream ( raw_ostream &  os) const
inlinevirtual

◆ getKind()

Kind clang::ento::SymExpr::getKind ( ) const
inline

◆ getOriginRegion()

virtual const MemRegion * clang::ento::SymExpr::getOriginRegion ( ) const
inlinevirtual

Find the region from which this symbol originates.

Whenever the symbol was constructed to denote an unknown value of a certain memory region, return this region. This method allows checkers to make decisions depending on the origin of the symbol. Symbol classes for which the origin region is known include SymbolRegionValue which denotes the value of the region before the beginning of the analysis, and SymbolDerived which denotes the value of a certain memory region after its super region (a memory space or a larger record region) is default-bound with a certain symbol. It might return null.

Reimplemented in clang::ento::SymbolRegionValue, and clang::ento::SymbolDerived.

Definition at line 124 of file SymExpr.h.

Referenced by clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt(), getOriginParam(), and unwrapRValueReferenceIndirection().

◆ getSymbolID()

SymbolID clang::ento::SymExpr::getSymbolID ( ) const
inline

Get a unique identifier for this symbol.

The ID is unique across all SymExprs in a SymbolManager. They reflect the allocation order of these SymExprs, and are likely stable across runs. Used as a key in SymbolRef containers and as part of identity for SymbolData, e.g. SymbolConjured with ID = 7 is "conj_$7".

Definition at line 77 of file SymExpr.h.

Referenced by clang::ento::SymbolRegionValue::dumpToStream(), clang::ento::SymbolConjured::dumpToStream(), clang::ento::SymbolDerived::dumpToStream(), clang::ento::SymbolExtent::dumpToStream(), clang::ento::SymbolMetadata::dumpToStream(), clang::ento::SMTConv::fromData(), llvm::ImutContainerInfo< clang::ento::SymbolRef >::isEqual(), and llvm::ImutContainerInfo< clang::ento::SymbolRef >::isLess().

◆ getType()

virtual QualType clang::ento::SymExpr::getType ( ) const
pure virtual

◆ isValidTypeForSymbol()

static bool clang::ento::SymExpr::isValidTypeForSymbol ( QualType  T)
inlinestaticprotected

Definition at line 58 of file SymExpr.h.

References clang::Type::isVoidType(), and clang::T.

Referenced by clang::ento::BinarySymExpr::BinarySymExpr().

◆ Profile()

virtual void clang::ento::SymExpr::Profile ( llvm::FoldingSetNodeID &  profile)
pure virtual

◆ symbols()

llvm::iterator_range< symbol_iterator > clang::ento::SymExpr::symbols ( ) const
inline

Member Data Documentation

◆ Complexity

unsigned clang::ento::SymExpr::Complexity = 0
mutableprotected

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