clang 20.0.0git
|
Symbolic value. More...
#include "clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h"
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_iterator > | symbols () const |
virtual unsigned | computeComplexity () const =0 |
virtual const MemRegion * | getOriginRegion () 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 |
Symbolic value.
These values used to capture symbolic execution of the program.
|
virtualdefault |
|
pure virtual |
|
virtual |
Definition at line 44 of file SymbolManager.cpp.
References dumpToStream().
|
inlinevirtual |
Reimplemented in clang::ento::SymbolRegionValue, clang::ento::SymbolConjured, clang::ento::SymbolDerived, clang::ento::SymbolExtent, clang::ento::SymbolMetadata, clang::ento::SymbolCast, clang::ento::UnarySymExpr, and clang::ento::BinarySymExprImpl< LHSTYPE, RHSTYPE, ClassKind >.
Definition at line 81 of file SymExpr.h.
Referenced by dump(), clang::ento::SymbolCast::dumpToStream(), clang::ento::UnarySymExpr::dumpToStream(), clang::ento::BinarySymExpr::dumpToStreamImpl(), clang::ento::operator<<(), and toString().
|
inline |
Definition at line 69 of file SymExpr.h.
Referenced by clang::ento::SymbolRegionValue::classof(), clang::ento::SymbolConjured::classof(), clang::ento::SymbolDerived::classof(), clang::ento::SymbolExtent::classof(), clang::ento::SymbolMetadata::classof(), clang::ento::SymbolCast::classof(), clang::ento::UnarySymExpr::classof(), clang::ento::BinarySymExpr::classof(), clang::ento::BinarySymExprImpl< LHSTYPE, RHSTYPE, ClassKind >::classof(), clang::ento::SymbolData::classof(), and clang::ento::SymbolReaper::isLive().
|
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().
|
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().
|
pure virtual |
Implemented in clang::ento::SymbolRegionValue, clang::ento::SymbolConjured, clang::ento::SymbolDerived, clang::ento::SymbolExtent, clang::ento::SymbolMetadata, clang::ento::SymbolCast, clang::ento::UnarySymExpr, and clang::ento::BinarySymExpr.
Referenced by clang::ento::iterator::assumeNoOverflow(), clang::ento::RangedConstraintManager::assumeSymInclusiveRange(), clang::ento::RangedConstraintManager::assumeSymRel(), clang::ento::RangedConstraintManager::assumeSymUnsupported(), clang::ento::SMTConstraintManager::canReasonAbout(), clang::ento::ConstraintManager::checkNull(), clang::ento::retaincountchecker::RetainCountChecker::checkPostStmt(), decomposeSymbol(), doRearrangeUnchecked(), clang::ento::retaincountchecker::RetainCountChecker::errorKindToBugKind(), clang::ento::SMTConv::fromData(), generateDiagnosticsForCallLike(), clang::ento::retaincountchecker::RefLeakReportVisitor::getEndPath(), clang::ento::SymbolicRegion::getPointeeStaticType(), clang::ento::SMTConv::getSymExpr(), clang::ento::SMTConstraintManager::getSymVal(), clang::ento::SymbolManager::getType(), isWithinConstantOverflowBounds(), clang::ento::SValBuilder::makeSymbolVal(), shouldRearrange(), clang::ento::nonloc::SymbolVal::SymbolVal(), tryRearrange(), unwrapRValueReferenceIndirection(), and clang::ento::SValExplainer::VisitSymbolicRegion().
Definition at line 58 of file SymExpr.h.
References clang::Type::isVoidType(), and clang::T.
Referenced by clang::ento::BinarySymExpr::BinarySymExpr().
|
pure virtual |
|
inline |
Definition at line 107 of file SymExpr.h.
Referenced by clang::ento::taint::getTaintedSymbolsImpl(), and clang::ento::ScanReachableSymbols::scan().
|
mutableprotected |
Definition at line 64 of file SymExpr.h.
Referenced by clang::ento::SymbolCast::computeComplexity(), clang::ento::UnarySymExpr::computeComplexity(), and clang::ento::BinarySymExprImpl< LHSTYPE, RHSTYPE, ClassKind >::computeComplexity().