clang 22.0.0git
clang::ento::BasicValueFactory Class Reference

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

Public Member Functions

 BasicValueFactory (ASTContext &ctx, llvm::BumpPtrAllocator &Alloc)
 ~BasicValueFactory ()
ASTContextgetContext () const
APSIntPtr getValue (const llvm::APSInt &X)
APSIntPtr getValue (const llvm::APInt &X, bool isUnsigned)
APSIntPtr getValue (uint64_t X, QualType T)
APSIntType getAPSIntType (QualType T) const
 Returns the type of the APSInt used to store values of the given QualType.
APSIntPtr Convert (const llvm::APSInt &To, const llvm::APSInt &From)
 Convert - Create a new persistent APSInt with the same value as 'From' but with the bitwidth and signedness of 'To'.
APSIntPtr Convert (QualType T, const llvm::APSInt &From)
APSIntPtr Convert (APSIntType TargetType, const llvm::APSInt &From)
APSIntPtr getIntValue (uint64_t X, bool isUnsigned)
APSIntPtr getMaxValue (const llvm::APSInt &v)
APSIntPtr getMinValue (const llvm::APSInt &v)
APSIntPtr getMaxValue (QualType T)
APSIntPtr getMinValue (QualType T)
APSIntPtr getMaxValue (APSIntType T)
APSIntPtr getMinValue (APSIntType T)
APSIntPtr Add1 (const llvm::APSInt &V)
APSIntPtr Sub1 (const llvm::APSInt &V)
APSIntPtr getZeroWithTypeSize (QualType T)
APSIntPtr getTruthValue (bool b, QualType T)
APSIntPtr getTruthValue (bool b)
const CompoundValDatagetCompoundValData (QualType T, llvm::ImmutableList< SVal > Vals)
const LazyCompoundValDatagetLazyCompoundValData (const StoreRef &store, const TypedValueRegion *region)
const PointerToMemberDatagetPointerToMemberData (const NamedDecl *ND, llvm::ImmutableList< const CXXBaseSpecifier * > L)
llvm::ImmutableList< SValgetEmptySValList ()
llvm::ImmutableList< SValprependSVal (SVal X, llvm::ImmutableList< SVal > L)
llvm::ImmutableList< const CXXBaseSpecifier * > getEmptyCXXBaseList ()
llvm::ImmutableList< const CXXBaseSpecifier * > prependCXXBase (const CXXBaseSpecifier *CBS, llvm::ImmutableList< const CXXBaseSpecifier * > L)
const PointerToMemberDataaccumCXXBase (llvm::iterator_range< CastExpr::path_const_iterator > PathRange, const nonloc::PointerToMember &PTM, const clang::CastKind &kind)
std::optional< APSIntPtrevalAPSInt (BinaryOperator::Opcode Op, const llvm::APSInt &V1, const llvm::APSInt &V2)
const std::pair< SVal, uintptr_t > & getPersistentSValWithData (const SVal &V, uintptr_t Data)
const std::pair< SVal, SVal > & getPersistentSValPair (const SVal &V1, const SVal &V2)
const SValgetPersistentSVal (SVal X)

Detailed Description

Definition at line 114 of file BasicValueFactory.h.

Constructor & Destructor Documentation

◆ BasicValueFactory()

clang::ento::BasicValueFactory::BasicValueFactory ( ASTContext & ctx,
llvm::BumpPtrAllocator & Alloc )
inline

Definition at line 136 of file BasicValueFactory.h.

◆ ~BasicValueFactory()

BasicValueFactory::~BasicValueFactory ( )

Definition at line 79 of file BasicValueFactory.cpp.

Member Function Documentation

◆ accumCXXBase()

const PointerToMemberData * BasicValueFactory::accumCXXBase ( llvm::iterator_range< CastExpr::path_const_iterator > PathRange,
const nonloc::PointerToMember & PTM,
const clang::CastKind & kind )

◆ Add1()

APSIntPtr clang::ento::BasicValueFactory::Add1 ( const llvm::APSInt & V)
inline

Definition at line 210 of file BasicValueFactory.h.

References V, and X.

◆ Convert() [1/3]

APSIntPtr clang::ento::BasicValueFactory::Convert ( APSIntType TargetType,
const llvm::APSInt & From )
inline

Definition at line 182 of file BasicValueFactory.h.

References clang::ento::APSIntType::convert().

◆ Convert() [2/3]

APSIntPtr clang::ento::BasicValueFactory::Convert ( const llvm::APSInt & To,
const llvm::APSInt & From )
inline

Convert - Create a new persistent APSInt with the same value as 'From' but with the bitwidth and signedness of 'To'.

Definition at line 169 of file BasicValueFactory.h.

References clang::ento::APSIntType::convert().

Referenced by Convert(), clang::ento::ProgramState::getSVal(), and clang::ento::SMTConstraintManager::getSymVal().

◆ Convert() [3/3]

APSIntPtr clang::ento::BasicValueFactory::Convert ( QualType T,
const llvm::APSInt & From )
inline

Definition at line 177 of file BasicValueFactory.h.

References Convert(), getAPSIntType(), and clang::T.

◆ evalAPSInt()

std::optional< APSIntPtr > BasicValueFactory::evalAPSInt ( BinaryOperator::Opcode Op,
const llvm::APSInt & V1,
const llvm::APSInt & V2 )

Definition at line 246 of file BasicValueFactory.cpp.

References getTruthValue().

Referenced by clang::ento::SMTConstraintManager::getSymVal().

◆ getAPSIntType()

◆ getCompoundValData()

const CompoundValData * BasicValueFactory::getCompoundValData ( QualType T,
llvm::ImmutableList< SVal > Vals )

Definition at line 125 of file BasicValueFactory.cpp.

References clang::ento::CompoundValData::Profile(), and clang::T.

◆ getContext()

◆ getEmptyCXXBaseList()

llvm::ImmutableList< const CXXBaseSpecifier * > clang::ento::BasicValueFactory::getEmptyCXXBaseList ( )
inline

Definition at line 254 of file BasicValueFactory.h.

◆ getEmptySValList()

llvm::ImmutableList< SVal > clang::ento::BasicValueFactory::getEmptySValList ( )
inline

◆ getIntValue()

APSIntPtr clang::ento::BasicValueFactory::getIntValue ( uint64_t X,
bool isUnsigned )
inline

Definition at line 189 of file BasicValueFactory.h.

References isUnsigned(), clang::T, and X.

Referenced by getStartIndex().

◆ getLazyCompoundValData()

const LazyCompoundValData * BasicValueFactory::getLazyCompoundValData ( const StoreRef & store,
const TypedValueRegion * region )

◆ getMaxValue() [1/3]

APSIntPtr clang::ento::BasicValueFactory::getMaxValue ( APSIntType T)
inline

Definition at line 206 of file BasicValueFactory.h.

References clang::T.

◆ getMaxValue() [2/3]

APSIntPtr clang::ento::BasicValueFactory::getMaxValue ( const llvm::APSInt & v)
inline

Definition at line 194 of file BasicValueFactory.h.

References getMaxValue().

Referenced by getMaxValue().

◆ getMaxValue() [3/3]

APSIntPtr clang::ento::BasicValueFactory::getMaxValue ( QualType T)
inline

Definition at line 202 of file BasicValueFactory.h.

References getAPSIntType(), getMaxValue(), and clang::T.

Referenced by getMaxValue().

◆ getMinValue() [1/3]

APSIntPtr clang::ento::BasicValueFactory::getMinValue ( APSIntType T)
inline

Definition at line 208 of file BasicValueFactory.h.

References clang::T.

◆ getMinValue() [2/3]

APSIntPtr clang::ento::BasicValueFactory::getMinValue ( const llvm::APSInt & v)
inline

Definition at line 198 of file BasicValueFactory.h.

References getMinValue().

Referenced by clang::ento::ProgramState::assumeInBoundDual(), and getMinValue().

◆ getMinValue() [3/3]

APSIntPtr clang::ento::BasicValueFactory::getMinValue ( QualType T)
inline

Definition at line 204 of file BasicValueFactory.h.

References getAPSIntType(), getMinValue(), and clang::T.

Referenced by getMinValue().

◆ getPersistentSVal()

const SVal * BasicValueFactory::getPersistentSVal ( SVal X)

Definition at line 380 of file BasicValueFactory.cpp.

References getPersistentSValWithData(), and X.

◆ getPersistentSValPair()

const std::pair< SVal, SVal > & BasicValueFactory::getPersistentSValPair ( const SVal & V1,
const SVal & V2 )

Definition at line 357 of file BasicValueFactory.cpp.

References clang::ento::SVal::Profile().

◆ getPersistentSValWithData()

const std::pair< SVal, uintptr_t > & BasicValueFactory::getPersistentSValWithData ( const SVal & V,
uintptr_t Data )

Definition at line 333 of file BasicValueFactory.cpp.

References clang::Data, and V.

Referenced by getPersistentSVal().

◆ getPointerToMemberData()

const PointerToMemberData * BasicValueFactory::getPointerToMemberData ( const NamedDecl * ND,
llvm::ImmutableList< const CXXBaseSpecifier * > L )

Definition at line 159 of file BasicValueFactory.cpp.

References clang::ento::PointerToMemberData::Profile().

Referenced by accumCXXBase().

◆ getTruthValue() [1/2]

APSIntPtr clang::ento::BasicValueFactory::getTruthValue ( bool b)
inline

Definition at line 232 of file BasicValueFactory.h.

References b, and getTruthValue().

◆ getTruthValue() [2/2]

APSIntPtr clang::ento::BasicValueFactory::getTruthValue ( bool b,
QualType T )
inline

Definition at line 227 of file BasicValueFactory.h.

References b, and clang::T.

Referenced by evalAPSInt(), and getTruthValue().

◆ getValue() [1/3]

APSIntPtr BasicValueFactory::getValue ( const llvm::APInt & X,
bool isUnsigned )

Definition at line 108 of file BasicValueFactory.cpp.

References isUnsigned(), V, and X.

◆ getValue() [2/3]

APSIntPtr BasicValueFactory::getValue ( const llvm::APSInt & X)

Definition at line 90 of file BasicValueFactory.cpp.

References clang::ento::APSIntPtr::unsafeConstructor(), and X.

◆ getValue() [3/3]

APSIntPtr BasicValueFactory::getValue ( uint64_t X,
QualType T )

Definition at line 120 of file BasicValueFactory.cpp.

References getAPSIntType(), clang::T, and X.

◆ getZeroWithTypeSize()

APSIntPtr clang::ento::BasicValueFactory::getZeroWithTypeSize ( QualType T)
inline

Definition at line 222 of file BasicValueFactory.h.

References clang::T.

◆ prependCXXBase()

llvm::ImmutableList< const CXXBaseSpecifier * > clang::ento::BasicValueFactory::prependCXXBase ( const CXXBaseSpecifier * CBS,
llvm::ImmutableList< const CXXBaseSpecifier * > L )
inline

Definition at line 258 of file BasicValueFactory.h.

Referenced by accumCXXBase().

◆ prependSVal()

llvm::ImmutableList< SVal > clang::ento::BasicValueFactory::prependSVal ( SVal X,
llvm::ImmutableList< SVal > L )
inline

Definition at line 250 of file BasicValueFactory.h.

References X.

Referenced by clang::ento::ExprEngine::ConstructInitList(), and processArgument().

◆ Sub1()

APSIntPtr clang::ento::BasicValueFactory::Sub1 ( const llvm::APSInt & V)
inline

Definition at line 216 of file BasicValueFactory.h.

References V, and X.


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