clang  6.0.0svn
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::ento::SValBuilder Class Referenceabstract

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

Collaboration diagram for clang::ento::SValBuilder:
Collaboration graph
[legend]

Public Member Functions

virtual SVal dispatchCast (SVal val, QualType castTy)=0
 
 SValBuilder (llvm::BumpPtrAllocator &alloc, ASTContext &context, ProgramStateManager &stateMgr)
 
virtual ~SValBuilder ()
 
bool haveSameType (const SymExpr *Sym1, const SymExpr *Sym2)
 
bool haveSameType (QualType Ty1, QualType Ty2)
 
SVal evalCast (SVal val, QualType castTy, QualType originalType)
 
SVal evalIntegralCast (ProgramStateRef state, SVal val, QualType castTy, QualType originalType)
 
virtual SVal evalMinus (NonLoc val)=0
 
virtual SVal evalComplement (NonLoc val)=0
 
virtual SVal evalBinOpNN (ProgramStateRef state, BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs, QualType resultTy)=0
 Create a new value which represents a binary expression with two non- location operands. More...
 
virtual SVal evalBinOpLL (ProgramStateRef state, BinaryOperator::Opcode op, Loc lhs, Loc rhs, QualType resultTy)=0
 Create a new value which represents a binary expression with two memory location operands. More...
 
virtual SVal evalBinOpLN (ProgramStateRef state, BinaryOperator::Opcode op, Loc lhs, NonLoc rhs, QualType resultTy)=0
 Create a new value which represents a binary expression with a memory location and non-location operands. More...
 
virtual const llvm::APSInt * getKnownValue (ProgramStateRef state, SVal val)=0
 Evaluates a given SVal. More...
 
virtual SVal simplifySVal (ProgramStateRef State, SVal Val)=0
 Simplify symbolic expressions within a given SVal. More...
 
SVal makeSymExprValNN (ProgramStateRef state, BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs, QualType resultTy)
 Constructs a symbolic expression for two non-location values. More...
 
SVal evalBinOp (ProgramStateRef state, BinaryOperator::Opcode op, SVal lhs, SVal rhs, QualType type)
 
DefinedOrUnknownSVal evalEQ (ProgramStateRef state, DefinedOrUnknownSVal lhs, DefinedOrUnknownSVal rhs)
 
ASTContextgetContext ()
 
const ASTContextgetContext () const
 
ProgramStateManagergetStateManager ()
 
QualType getConditionType () const
 
QualType getArrayIndexType () const
 
BasicValueFactorygetBasicValueFactory ()
 
const BasicValueFactorygetBasicValueFactory () const
 
SymbolManagergetSymbolManager ()
 
const SymbolManagergetSymbolManager () const
 
MemRegionManagergetRegionManager ()
 
const MemRegionManagergetRegionManager () const
 
const SymbolConjuredconjureSymbol (const Stmt *stmt, const LocationContext *LCtx, QualType type, unsigned visitCount, const void *symbolTag=nullptr)
 
const SymbolConjuredconjureSymbol (const Expr *expr, const LocationContext *LCtx, unsigned visitCount, const void *symbolTag=nullptr)
 
DefinedOrUnknownSVal makeZeroVal (QualType type)
 Construct an SVal representing '0' for the specified type. More...
 
DefinedOrUnknownSVal getRegionValueSymbolVal (const TypedValueRegion *region)
 Make a unique symbol for value of region. More...
 
DefinedOrUnknownSVal conjureSymbolVal (const void *symbolTag, const Expr *expr, const LocationContext *LCtx, unsigned count)
 Create a new symbol with a unique 'name'. More...
 
DefinedOrUnknownSVal conjureSymbolVal (const void *symbolTag, const Expr *expr, const LocationContext *LCtx, QualType type, unsigned count)
 
DefinedOrUnknownSVal conjureSymbolVal (const Stmt *stmt, const LocationContext *LCtx, QualType type, unsigned visitCount)
 
DefinedOrUnknownSVal getConjuredHeapSymbolVal (const Expr *E, const LocationContext *LCtx, unsigned Count)
 Conjure a symbol representing heap allocated memory region. More...
 
DefinedOrUnknownSVal getDerivedRegionValueSymbolVal (SymbolRef parentSymbol, const TypedValueRegion *region)
 
DefinedSVal getMetadataSymbolVal (const void *symbolTag, const MemRegion *region, const Expr *expr, QualType type, const LocationContext *LCtx, unsigned count)
 
DefinedSVal getMemberPointer (const DeclaratorDecl *DD)
 
DefinedSVal getFunctionPointer (const FunctionDecl *func)
 
DefinedSVal getBlockPointer (const BlockDecl *block, CanQualType locTy, const LocationContext *locContext, unsigned blockCount)
 
Optional< SValgetConstantVal (const Expr *E)
 Returns the value of E, if it can be determined in a non-path-sensitive manner. More...
 
NonLoc makeCompoundVal (QualType type, llvm::ImmutableList< SVal > vals)
 
NonLoc makeLazyCompoundVal (const StoreRef &store, const TypedValueRegion *region)
 
NonLoc makePointerToMember (const DeclaratorDecl *DD)
 
NonLoc makePointerToMember (const PointerToMemberData *PTMD)
 
NonLoc makeZeroArrayIndex ()
 
NonLoc makeArrayIndex (uint64_t idx)
 
SVal convertToArrayIndex (SVal val)
 
nonloc::ConcreteInt makeIntVal (const IntegerLiteral *integer)
 
nonloc::ConcreteInt makeBoolVal (const ObjCBoolLiteralExpr *boolean)
 
nonloc::ConcreteInt makeBoolVal (const CXXBoolLiteralExpr *boolean)
 
nonloc::ConcreteInt makeIntVal (const llvm::APSInt &integer)
 
loc::ConcreteInt makeIntLocVal (const llvm::APSInt &integer)
 
NonLoc makeIntVal (const llvm::APInt &integer, bool isUnsigned)
 
DefinedSVal makeIntVal (uint64_t integer, QualType type)
 
NonLoc makeIntVal (uint64_t integer, bool isUnsigned)
 
NonLoc makeIntValWithPtrWidth (uint64_t integer, bool isUnsigned)
 
NonLoc makeLocAsInteger (Loc loc, unsigned bits)
 
NonLoc makeNonLoc (const SymExpr *lhs, BinaryOperator::Opcode op, const llvm::APSInt &rhs, QualType type)
 
NonLoc makeNonLoc (const llvm::APSInt &rhs, BinaryOperator::Opcode op, const SymExpr *lhs, QualType type)
 
NonLoc makeNonLoc (const SymExpr *lhs, BinaryOperator::Opcode op, const SymExpr *rhs, QualType type)
 
NonLoc makeNonLoc (const SymExpr *operand, QualType fromTy, QualType toTy)
 Create a NonLoc value for cast. More...
 
nonloc::ConcreteInt makeTruthVal (bool b, QualType type)
 
nonloc::ConcreteInt makeTruthVal (bool b)
 
Loc makeNullWithType (QualType type)
 Create NULL pointer, with proper pointer bit-width for given address space. More...
 
Loc makeNull ()
 
Loc makeLoc (SymbolRef sym)
 
Loc makeLoc (const MemRegion *region)
 
Loc makeLoc (const AddrLabelExpr *expr)
 
Loc makeLoc (const llvm::APSInt &integer)
 
loc::MemRegionVal getCXXThis (const CXXMethodDecl *D, const StackFrameContext *SFC)
 Return a memory region for the 'this' object reference. More...
 
loc::MemRegionVal getCXXThis (const CXXRecordDecl *D, const StackFrameContext *SFC)
 Return a memory region for the 'this' object reference. More...
 

Protected Member Functions

virtual SVal evalCastFromNonLoc (NonLoc val, QualType castTy)=0
 
virtual SVal evalCastFromLoc (Loc val, QualType castTy)=0
 

Protected Attributes

ASTContextContext
 
BasicValueFactory BasicVals
 Manager of APSInt values. More...
 
SymbolManager SymMgr
 Manages the creation of symbols. More...
 
MemRegionManager MemMgr
 Manages the creation of memory regions. More...
 
ProgramStateManagerStateMgr
 
const QualType ArrayIndexTy
 The scalar type to use for array indices. More...
 
const unsigned ArrayIndexWidth
 The width of the scalar type used for array indices. More...
 

Detailed Description

Definition at line 32 of file SValBuilder.h.

Constructor & Destructor Documentation

◆ SValBuilder()

clang::ento::SValBuilder::SValBuilder ( llvm::BumpPtrAllocator &  alloc,
ASTContext context,
ProgramStateManager stateMgr 
)
inline

Definition at line 63 of file SValBuilder.h.

◆ ~SValBuilder()

virtual clang::ento::SValBuilder::~SValBuilder ( )
inlinevirtual

Definition at line 72 of file SValBuilder.h.

Member Function Documentation

◆ conjureSymbol() [1/2]

const SymbolConjured* clang::ento::SValBuilder::conjureSymbol ( const Stmt stmt,
const LocationContext LCtx,
QualType  type,
unsigned  visitCount,
const void *  symbolTag = nullptr 
)
inline

Definition at line 155 of file SValBuilder.h.

References clang::ento::SymbolManager::conjureSymbol().

◆ conjureSymbol() [2/2]

const SymbolConjured* clang::ento::SValBuilder::conjureSymbol ( const Expr expr,
const LocationContext LCtx,
unsigned  visitCount,
const void *  symbolTag = nullptr 
)
inline

◆ conjureSymbolVal() [1/3]

DefinedOrUnknownSVal SValBuilder::conjureSymbolVal ( const void *  symbolTag,
const Expr expr,
const LocationContext LCtx,
unsigned  count 
)

Create a new symbol with a unique 'name'.

We resort to conjured symbols when we cannot construct a derived symbol. The advantage of symbols derived/built from other symbols is that we preserve the relation between related(or even equivalent) expressions, so conjured symbols should be used sparingly.

Definition at line 115 of file SValBuilder.cpp.

References clang::LocationContext::getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isNullPtrType(), makeZeroVal(), and clang::T.

Referenced by conjureOffsetSymbolOnLocation(), conjureSymbol(), clang::ento::ExprEngine::handleLVectorSplat(), clang::ento::ExprEngine::ProcessInitializer(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitCXXCatchStmt(), clang::ento::ExprEngine::VisitCXXNewExpr(), and clang::ento::ExprEngine::VisitGuardedExpr().

◆ conjureSymbolVal() [2/3]

DefinedOrUnknownSVal SValBuilder::conjureSymbolVal ( const void *  symbolTag,
const Expr expr,
const LocationContext LCtx,
QualType  type,
unsigned  count 
)

◆ conjureSymbolVal() [3/3]

DefinedOrUnknownSVal SValBuilder::conjureSymbolVal ( const Stmt stmt,
const LocationContext LCtx,
QualType  type,
unsigned  visitCount 
)

◆ convertToArrayIndex()

SVal SValBuilder::convertToArrayIndex ( SVal  val)

◆ dispatchCast()

virtual SVal clang::ento::SValBuilder::dispatchCast ( SVal  val,
QualType  castTy 
)
pure virtual

◆ evalBinOp()

SVal SValBuilder::evalBinOp ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
SVal  lhs,
SVal  rhs,
QualType  type 
)

◆ evalBinOpLL()

virtual SVal clang::ento::SValBuilder::evalBinOpLL ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
Loc  lhs,
Loc  rhs,
QualType  resultTy 
)
pure virtual

Create a new value which represents a binary expression with two memory location operands.

Referenced by evalBinOp(), and haveSameType().

◆ evalBinOpLN()

virtual SVal clang::ento::SValBuilder::evalBinOpLN ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
Loc  lhs,
NonLoc  rhs,
QualType  resultTy 
)
pure virtual

Create a new value which represents a binary expression with a memory location and non-location operands.

For example, this would be used to evaluate a pointer arithmetic operation.

Referenced by evalBinOp(), and haveSameType().

◆ evalBinOpNN()

virtual SVal clang::ento::SValBuilder::evalBinOpNN ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
NonLoc  lhs,
NonLoc  rhs,
QualType  resultTy 
)
pure virtual

Create a new value which represents a binary expression with two non- location operands.

Referenced by addValue(), clang::ento::ProgramState::assumeInBound(), evalBinOp(), clang::ento::ExprEngine::evalBinOp(), evalIntegralCast(), getSimplifiedOffsets(), haveSameType(), and scaleValue().

◆ evalCast()

SVal SValBuilder::evalCast ( SVal  val,
QualType  castTy,
QualType  originalType 
)

◆ evalCastFromLoc()

virtual SVal clang::ento::SValBuilder::evalCastFromLoc ( Loc  val,
QualType  castTy 
)
protectedpure virtual

Referenced by evalCast().

◆ evalCastFromNonLoc()

virtual SVal clang::ento::SValBuilder::evalCastFromNonLoc ( NonLoc  val,
QualType  castTy 
)
protectedpure virtual

◆ evalComplement()

virtual SVal clang::ento::SValBuilder::evalComplement ( NonLoc  val)
pure virtual

◆ evalEQ()

DefinedOrUnknownSVal SValBuilder::evalEQ ( ProgramStateRef  state,
DefinedOrUnknownSVal  lhs,
DefinedOrUnknownSVal  rhs 
)

Definition at line 416 of file SValBuilder.cpp.

References clang::ento::SVal::castAs(), evalBinOp(), and getConditionType().

Referenced by GetCFNumberSize(), and haveSameType().

◆ evalIntegralCast()

SVal SValBuilder::evalIntegralCast ( ProgramStateRef  state,
SVal  val,
QualType  castTy,
QualType  originalType 
)

◆ evalMinus()

virtual SVal clang::ento::SValBuilder::evalMinus ( NonLoc  val)
pure virtual

◆ getArrayIndexType()

QualType clang::ento::SValBuilder::getArrayIndexType ( ) const
inline

◆ getBasicValueFactory() [1/2]

BasicValueFactory& clang::ento::SValBuilder::getBasicValueFactory ( )
inline

◆ getBasicValueFactory() [2/2]

const BasicValueFactory& clang::ento::SValBuilder::getBasicValueFactory ( ) const
inline

Definition at line 145 of file SValBuilder.h.

References BasicVals.

◆ getBlockPointer()

DefinedSVal SValBuilder::getBlockPointer ( const BlockDecl block,
CanQualType  locTy,
const LocationContext locContext,
unsigned  blockCount 
)

◆ getConditionType()

QualType clang::ento::SValBuilder::getConditionType ( ) const
inline

◆ getConjuredHeapSymbolVal()

DefinedOrUnknownSVal SValBuilder::getConjuredHeapSymbolVal ( const Expr E,
const LocationContext LCtx,
unsigned  Count 
)

Conjure a symbol representing heap allocated memory region.

Note, the expression should represent a location.

Definition at line 172 of file SValBuilder.cpp.

Referenced by conjureSymbol(), and clang::ento::ExprEngine::VisitCXXNewExpr().

◆ getConstantVal()

Optional< SVal > SValBuilder::getConstantVal ( const Expr E)

Returns the value of E, if it can be determined in a non-path-sensitive manner.

If E is not a constant or cannot be modeled, returns None.

Definition at line 266 of file SValBuilder.cpp.

◆ getContext() [1/2]

ASTContext& clang::ento::SValBuilder::getContext ( )
inline

◆ getContext() [2/2]

const ASTContext& clang::ento::SValBuilder::getContext ( ) const
inline

Definition at line 132 of file SValBuilder.h.

References Context.

◆ getCXXThis() [1/2]

loc::MemRegionVal SValBuilder::getCXXThis ( const CXXMethodDecl D,
const StackFrameContext SFC 
)

◆ getCXXThis() [2/2]

loc::MemRegionVal SValBuilder::getCXXThis ( const CXXRecordDecl D,
const StackFrameContext SFC 
)

Return a memory region for the 'this' object reference.

Definition at line 259 of file SValBuilder.cpp.

References getContext(), clang::ASTContext::getPointerType(), getRegionManager(), clang::TypeDecl::getTypeForDecl(), and clang::T.

◆ getDerivedRegionValueSymbolVal()

DefinedOrUnknownSVal SValBuilder::getDerivedRegionValueSymbolVal ( SymbolRef  parentSymbol,
const TypedValueRegion region 
)

◆ getFunctionPointer()

DefinedSVal SValBuilder::getFunctionPointer ( const FunctionDecl func)

Definition at line 236 of file SValBuilder.cpp.

References clang::ento::MemRegionManager::getFunctionCodeRegion(), and MemMgr.

Referenced by getMemberPointer().

◆ getKnownValue()

virtual const llvm::APSInt* clang::ento::SValBuilder::getKnownValue ( ProgramStateRef  state,
SVal  val 
)
pure virtual

Evaluates a given SVal.

If the SVal has only one possible (integer) value, that value is returned. Otherwise, returns NULL.

Referenced by haveSameType().

◆ getMemberPointer()

DefinedSVal SValBuilder::getMemberPointer ( const DeclaratorDecl DD)

Definition at line 220 of file SValBuilder.cpp.

References getFunctionPointer(), and clang::prec::PointerToMember.

◆ getMetadataSymbolVal()

DefinedSVal SValBuilder::getMetadataSymbolVal ( const void *  symbolTag,
const MemRegion region,
const Expr expr,
QualType  type,
const LocationContext LCtx,
unsigned  count 
)

◆ getRegionManager() [1/2]

MemRegionManager& clang::ento::SValBuilder::getRegionManager ( )
inline

◆ getRegionManager() [2/2]

const MemRegionManager& clang::ento::SValBuilder::getRegionManager ( ) const
inline

Definition at line 151 of file SValBuilder.h.

References MemMgr.

◆ getRegionValueSymbolVal()

DefinedOrUnknownSVal SValBuilder::getRegionValueSymbolVal ( const TypedValueRegion region)

◆ getStateManager()

ProgramStateManager& clang::ento::SValBuilder::getStateManager ( )
inline

Definition at line 134 of file SValBuilder.h.

References StateMgr.

◆ getSymbolManager() [1/2]

SymbolManager& clang::ento::SValBuilder::getSymbolManager ( )
inline

◆ getSymbolManager() [2/2]

const SymbolManager& clang::ento::SValBuilder::getSymbolManager ( ) const
inline

Definition at line 148 of file SValBuilder.h.

References SymMgr.

◆ haveSameType() [1/2]

bool clang::ento::SValBuilder::haveSameType ( const SymExpr Sym1,
const SymExpr Sym2 
)
inline

Definition at line 74 of file SValBuilder.h.

References clang::ento::SymExpr::getType().

◆ haveSameType() [2/2]

bool clang::ento::SValBuilder::haveSameType ( QualType  Ty1,
QualType  Ty2 
)
inline

◆ makeArrayIndex()

NonLoc clang::ento::SValBuilder::makeArrayIndex ( uint64_t  idx)
inline

◆ makeBoolVal() [1/2]

nonloc::ConcreteInt clang::ento::SValBuilder::makeBoolVal ( const ObjCBoolLiteralExpr boolean)
inline

Definition at line 260 of file SValBuilder.h.

References clang::ObjCBoolLiteralExpr::getValue(), and makeTruthVal().

◆ makeBoolVal() [2/2]

nonloc::ConcreteInt SValBuilder::makeBoolVal ( const CXXBoolLiteralExpr boolean)

Definition at line 93 of file SValBuilder.cpp.

References clang::CXXBoolLiteralExpr::getValue(), and makeTruthVal().

◆ makeCompoundVal()

NonLoc clang::ento::SValBuilder::makeCompoundVal ( QualType  type,
llvm::ImmutableList< SVal vals 
)
inline

◆ makeIntLocVal()

loc::ConcreteInt clang::ento::SValBuilder::makeIntLocVal ( const llvm::APSInt &  integer)
inline

Definition at line 270 of file SValBuilder.h.

◆ makeIntVal() [1/5]

nonloc::ConcreteInt clang::ento::SValBuilder::makeIntVal ( const IntegerLiteral integer)
inline

◆ makeIntVal() [2/5]

nonloc::ConcreteInt clang::ento::SValBuilder::makeIntVal ( const llvm::APSInt &  integer)
inline

Definition at line 266 of file SValBuilder.h.

◆ makeIntVal() [3/5]

NonLoc clang::ento::SValBuilder::makeIntVal ( const llvm::APInt &  integer,
bool  isUnsigned 
)
inline

Definition at line 274 of file SValBuilder.h.

◆ makeIntVal() [4/5]

DefinedSVal clang::ento::SValBuilder::makeIntVal ( uint64_t  integer,
QualType  type 
)
inline

Definition at line 278 of file SValBuilder.h.

References clang::ento::Loc::isLocType().

◆ makeIntVal() [5/5]

NonLoc clang::ento::SValBuilder::makeIntVal ( uint64_t  integer,
bool  isUnsigned 
)
inline

Definition at line 285 of file SValBuilder.h.

References clang::ento::BasicValueFactory::getIntValue().

◆ makeIntValWithPtrWidth()

NonLoc clang::ento::SValBuilder::makeIntValWithPtrWidth ( uint64_t  integer,
bool  isUnsigned 
)
inline

◆ makeLazyCompoundVal()

NonLoc clang::ento::SValBuilder::makeLazyCompoundVal ( const StoreRef store,
const TypedValueRegion region 
)
inline

◆ makeLoc() [1/4]

Loc clang::ento::SValBuilder::makeLoc ( SymbolRef  sym)
inline

◆ makeLoc() [2/4]

Loc clang::ento::SValBuilder::makeLoc ( const MemRegion region)
inline

Definition at line 333 of file SValBuilder.h.

◆ makeLoc() [3/4]

Loc clang::ento::SValBuilder::makeLoc ( const AddrLabelExpr expr)
inline

Definition at line 337 of file SValBuilder.h.

References clang::AddrLabelExpr::getLabel().

◆ makeLoc() [4/4]

Loc clang::ento::SValBuilder::makeLoc ( const llvm::APSInt &  integer)
inline

Definition at line 341 of file SValBuilder.h.

References clang::ento::createSimpleSValBuilder(), and getCXXThis().

◆ makeLocAsInteger()

NonLoc clang::ento::SValBuilder::makeLocAsInteger ( Loc  loc,
unsigned  bits 
)
inline

◆ makeNonLoc() [1/4]

NonLoc SValBuilder::makeNonLoc ( const SymExpr lhs,
BinaryOperator::Opcode  op,
const llvm::APSInt &  rhs,
QualType  type 
)

◆ makeNonLoc() [2/4]

NonLoc SValBuilder::makeNonLoc ( const llvm::APSInt &  rhs,
BinaryOperator::Opcode  op,
const SymExpr lhs,
QualType  type 
)

◆ makeNonLoc() [3/4]

NonLoc SValBuilder::makeNonLoc ( const SymExpr lhs,
BinaryOperator::Opcode  op,
const SymExpr rhs,
QualType  type 
)

◆ makeNonLoc() [4/4]

NonLoc SValBuilder::makeNonLoc ( const SymExpr operand,
QualType  fromTy,
QualType  toTy 
)

Create a NonLoc value for cast.

Definition at line 72 of file SValBuilder.cpp.

References clang::ento::SymbolManager::getCastSymbol(), clang::ento::Loc::isLocType(), and SymMgr.

◆ makeNull()

Loc clang::ento::SValBuilder::makeNull ( )
inline

Definition at line 325 of file SValBuilder.h.

References clang::ento::BasicValueFactory::getZeroWithPtrWidth().

Referenced by makeZeroVal().

◆ makeNullWithType()

Loc clang::ento::SValBuilder::makeNullWithType ( QualType  type)
inline

Create NULL pointer, with proper pointer bit-width for given address space.

Parameters
typepointer type.

Definition at line 321 of file SValBuilder.h.

References clang::ento::BasicValueFactory::getZeroWithTypeSize().

◆ makePointerToMember() [1/2]

NonLoc clang::ento::SValBuilder::makePointerToMember ( const DeclaratorDecl DD)
inline

Definition at line 236 of file SValBuilder.h.

References clang::prec::PointerToMember.

◆ makePointerToMember() [2/2]

NonLoc clang::ento::SValBuilder::makePointerToMember ( const PointerToMemberData PTMD)
inline

Definition at line 240 of file SValBuilder.h.

References clang::prec::PointerToMember.

◆ makeSymExprValNN()

SVal SValBuilder::makeSymExprValNN ( ProgramStateRef  state,
BinaryOperator::Opcode  op,
NonLoc  lhs,
NonLoc  rhs,
QualType  resultTy 
)

Constructs a symbolic expression for two non-location values.

Definition at line 353 of file SValBuilder.cpp.

References clang::ento::SymExpr::computeComplexity(), clang::ento::SVal::getAs(), clang::ento::SVal::getAsSymExpr(), and makeNonLoc().

Referenced by haveSameType().

◆ makeTruthVal() [1/2]

nonloc::ConcreteInt clang::ento::SValBuilder::makeTruthVal ( bool  b,
QualType  type 
)
inline

Definition at line 310 of file SValBuilder.h.

References clang::ento::BasicValueFactory::getTruthValue().

Referenced by evalCast(), and makeBoolVal().

◆ makeTruthVal() [2/2]

nonloc::ConcreteInt clang::ento::SValBuilder::makeTruthVal ( bool  b)
inline

Definition at line 314 of file SValBuilder.h.

References clang::ento::BasicValueFactory::getTruthValue().

◆ makeZeroArrayIndex()

NonLoc clang::ento::SValBuilder::makeZeroArrayIndex ( )
inline

◆ makeZeroVal()

DefinedOrUnknownSVal SValBuilder::makeZeroVal ( QualType  type)

◆ simplifySVal()

virtual SVal clang::ento::SValBuilder::simplifySVal ( ProgramStateRef  State,
SVal  Val 
)
pure virtual

Simplify symbolic expressions within a given SVal.

Return an SVal that represents the same value, but is hopefully easier to work with than the original SVal.

Referenced by haveSameType().

Member Data Documentation

◆ ArrayIndexTy

const QualType clang::ento::SValBuilder::ArrayIndexTy
protected

The scalar type to use for array indices.

Definition at line 49 of file SValBuilder.h.

Referenced by getArrayIndexType().

◆ ArrayIndexWidth

const unsigned clang::ento::SValBuilder::ArrayIndexWidth
protected

The width of the scalar type used for array indices.

Definition at line 52 of file SValBuilder.h.

◆ BasicVals

BasicValueFactory clang::ento::SValBuilder::BasicVals
protected

Manager of APSInt values.

Definition at line 38 of file SValBuilder.h.

Referenced by getBasicValueFactory(), and makeZeroVal().

◆ Context

ASTContext& clang::ento::SValBuilder::Context
protected

Definition at line 35 of file SValBuilder.h.

Referenced by evalCast(), and getContext().

◆ MemMgr

MemRegionManager clang::ento::SValBuilder::MemMgr
protected

◆ StateMgr

ProgramStateManager& clang::ento::SValBuilder::StateMgr
protected

Definition at line 46 of file SValBuilder.h.

Referenced by evalCast(), and getStateManager().

◆ SymMgr

SymbolManager clang::ento::SValBuilder::SymMgr
protected

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