clang 18.0.0git
|
#include "clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h"
Protected Attributes | |
ASTContext & | Context |
BasicValueFactory | BasicVals |
Manager of APSInt values. | |
SymbolManager | SymMgr |
Manages the creation of symbols. | |
MemRegionManager | MemMgr |
Manages the creation of memory regions. | |
ProgramStateManager & | StateMgr |
const AnalyzerOptions & | AnOpts |
const QualType | ArrayIndexTy |
The scalar type to use for array indices. | |
const unsigned | ArrayIndexWidth |
The width of the scalar type used for array indices. | |
Definition at line 53 of file SValBuilder.h.
SValBuilder::SValBuilder | ( | llvm::BumpPtrAllocator & | alloc, |
ASTContext & | context, | ||
ProgramStateManager & | stateMgr | ||
) |
Definition at line 52 of file SValBuilder.cpp.
|
virtualdefault |
ConditionTruthVal SValBuilder::areEqual | ( | ProgramStateRef | state, |
SVal | lhs, | ||
SVal | rhs | ||
) |
lhs
and rhs
are equal at state
. Definition at line 535 of file SValBuilder.cpp.
References evalEQ().
Referenced by clang::ento::ProgramState::areEqual(), and wasRegionOfInterestModifiedAt().
|
inline |
Definition at line 170 of file SValBuilder.h.
References clang::ento::SymbolManager::conjureSymbol(), clang::ast_matchers::expr, and SymMgr.
|
inline |
Definition at line 162 of file SValBuilder.h.
References clang::ento::SymbolManager::conjureSymbol(), clang::ast_matchers::stmt, SymMgr, and clang::ast_matchers::type.
DefinedOrUnknownSVal SValBuilder::conjureSymbolVal | ( | const Stmt * | stmt, |
const LocationContext * | LCtx, | ||
QualType | type, | ||
unsigned | visitCount | ||
) |
Definition at line 195 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::conjureSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), makeZeroVal(), MemMgr, clang::ast_matchers::stmt, SymMgr, and clang::ast_matchers::type.
DefinedOrUnknownSVal SValBuilder::conjureSymbolVal | ( | const void * | symbolTag, |
const Expr * | expr, | ||
const LocationContext * | LCtx, | ||
QualType | type, | ||
unsigned | count | ||
) |
Definition at line 176 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::conjureSymbol(), clang::ast_matchers::expr, clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), makeZeroVal(), MemMgr, SymMgr, and clang::ast_matchers::type.
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 158 of file SValBuilder.cpp.
References conjureSymbolVal(), clang::LocationContext::getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isNullPtrType(), and makeZeroVal().
Referenced by clang::ento::ExprEngine::bindReturnValue(), clang::ento::ExprEngine::computeObjectUnderConstruction(), conjureOffsetSymbolOnLocation(), conjureSymbolVal(), clang::ento::retaincountchecker::RetainCountChecker::evalCall(), clang::ento::ExprEngine::ProcessInitializer(), clang::ento::ExprEngine::Visit(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCXXCatchStmt(), clang::ento::ExprEngine::VisitCXXNewExpr(), clang::ento::ExprEngine::VisitDeclStmt(), clang::ento::ExprEngine::VisitGuardedExpr(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
Definition at line 121 of file SValBuilder.cpp.
References ArrayIndexTy, ArrayIndexWidth, evalCast(), clang::ento::SVal::getAs(), and clang::ento::SVal::isUnknownOrUndef().
Referenced by clang::ento::StoreManager::getLValueElement().
SVal SValBuilder::evalBinOp | ( | ProgramStateRef | state, |
BinaryOperator::Opcode | op, | ||
SVal | lhs, | ||
SVal | rhs, | ||
QualType | type | ||
) |
Definition at line 485 of file SValBuilder.cpp.
References clang::ento::SVal::castAs(), evalBinOpLL(), evalBinOpLN(), evalBinOpNN(), clang::ento::SVal::getAs(), clang::ento::SVal::isUndef(), clang::ento::SVal::isUnknown(), makeIntVal(), and clang::ast_matchers::type.
Referenced by assumeCollectionNonEmpty(), clang::ento::ExprEngine::bindReturnValue(), clang::ento::ExprEngine::evalBinOp(), evalComparison(), evalEQ(), and clang::ento::errno_modeling::setErrnoForStdFailure().
|
pure virtual |
Create a new value which represents a binary expression with two memory location operands.
Referenced by evalBinOp().
|
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().
|
pure virtual |
Create a new value which represents a binary expression with two non- location operands.
Referenced by clang::ento::ProgramState::assumeInBoundDual(), clang::ento::iterator::assumeNoOverflow(), compareValueToThreshold(), doRearrangeUnchecked(), evalBinOp(), evalIntegralCast(), and isInRelation().
Cast a given SVal to another SVal using given QualType's.
V | – SVal that should be casted. |
CastTy | – QualType that V should be casted according to. |
OriginalTy | – QualType which is associated to V. It provides additional information about what type the cast performs from. |
OriginalTy.isNull()
is true, then cast performs based on CastTy only. This behavior is uncertain and should be improved. Definition at line 1091 of file SValBuilder.cpp.
References V.
Referenced by clang::ento::SimpleConstraintManager::assumeInternal(), castArgToParamTypeIfNeeded(), convertToArrayIndex(), evalIntegralCast(), getConstantVal(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), clang::ento::ExprEngine::handleLValueBitCast(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::VisitBinaryOperator(), clang::ento::ExprEngine::VisitCast(), clang::ento::ExprEngine::VisitCXXNewExpr(), and clang::ento::ExprEngine::VisitLogicalExpr().
Definition at line 460 of file SValBuilder.cpp.
References Context, clang::ento::nonloc::SymbolVal::getSymbol(), clang::ento::nonloc::ConcreteInt::getValue(), makeIntVal(), makeNonLoc(), and X.
Referenced by evalUnaryOp(), and clang::ento::ExprEngine::VisitUnaryOperator().
DefinedOrUnknownSVal SValBuilder::evalEQ | ( | ProgramStateRef | state, |
DefinedOrUnknownSVal | lhs, | ||
DefinedOrUnknownSVal | rhs | ||
) |
Definition at line 544 of file SValBuilder.cpp.
References clang::ento::SVal::castAs(), and evalEQ().
SVal SValBuilder::evalEQ | ( | ProgramStateRef | state, |
SVal | lhs, | ||
SVal | rhs | ||
) |
Definition at line 540 of file SValBuilder.cpp.
References evalBinOp(), and getConditionType().
Referenced by areEqual(), evalEQ(), mayBeSuccess(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
SVal SValBuilder::evalIntegralCast | ( | ProgramStateRef | state, |
SVal | val, | ||
QualType | castTy, | ||
QualType | originalType | ||
) |
Definition at line 587 of file SValBuilder.cpp.
References clang::ento::SVal::castAs(), evalBinOpNN(), evalCast(), clang::ento::SVal::getAsSymbol(), getConditionType(), getContext(), clang::ento::APSIntType::getMaxValue(), clang::Type::isUnsignedIntegerType(), makeIntVal(), and makeNonLoc().
Referenced by clang::ento::ExprEngine::VisitCast().
Definition at line 448 of file SValBuilder.cpp.
References Context, clang::ento::nonloc::SymbolVal::getSymbol(), clang::ento::nonloc::ConcreteInt::getValue(), makeIntVal(), makeNonLoc(), and X.
Referenced by evalUnaryOp(), clang::ento::ExprEngine::handleLValueBitCast(), and clang::ento::ExprEngine::VisitUnaryOperator().
SVal SValBuilder::evalUnaryOp | ( | ProgramStateRef | state, |
UnaryOperator::Opcode | opc, | ||
SVal | operand, | ||
QualType | type | ||
) |
Definition at line 472 of file SValBuilder.cpp.
References evalComplement(), evalMinus(), and clang::ento::SVal::getAs().
|
inline |
|
inline |
Definition at line 145 of file SValBuilder.h.
References ArrayIndexTy.
Referenced by clang::ento::ProgramState::assumeInBoundDual(), clang::ento::ExprEngine::bindReturnValue(), and clang::ento::MemRegionManager::getStaticSize().
|
inline |
Definition at line 149 of file SValBuilder.h.
References BasicVals.
Referenced by clang::ento::ProgramState::assumeInBoundDual(), clang::ento::iterator::assumeNoOverflow(), doRearrangeUnchecked(), clang::ento::SimpleConstraintManager::getBasicVals(), clang::ento::StoreManager::getLValueElement(), isWithinConstantOverflowBounds(), and processArgument().
|
inline |
Definition at line 150 of file SValBuilder.h.
References BasicVals.
DefinedSVal SValBuilder::getBlockPointer | ( | const BlockDecl * | block, |
CanQualType | locTy, | ||
const LocationContext * | locContext, | ||
unsigned | blockCount | ||
) |
Definition at line 289 of file SValBuilder.cpp.
References clang::LocationContext::getAnalysisDeclContext(), clang::ento::MemRegionManager::getBlockCodeRegion(), clang::ento::MemRegionManager::getBlockDataRegion(), and MemMgr.
Referenced by clang::ento::ExprEngine::VisitBlockExpr().
std::optional< loc::MemRegionVal > SValBuilder::getCastedMemRegionVal | ( | const MemRegion * | region, |
QualType | type | ||
) |
Return MemRegionVal on success cast, otherwise return std::nullopt.
Definition at line 301 of file SValBuilder.cpp.
References clang::ento::StoreManager::castRegion(), clang::ento::ProgramStateManager::getStoreManager(), and StateMgr.
|
inline |
Definition at line 141 of file SValBuilder.h.
References clang::ASTContext::BoolTy, Context, clang::ASTContext::getLangOpts(), and clang::ASTContext::IntTy.
Referenced by assumeCollectionNonEmpty(), clang::ento::iterator::assumeNoOverflow(), compareValueToThreshold(), doRearrangeUnchecked(), evalComparison(), evalEQ(), evalIntegralCast(), clang::ento::ExprEngine::getInitialState(), isInRelation(), clang::ento::errno_modeling::setErrnoForStdFailure(), and tryRearrange().
DefinedOrUnknownSVal SValBuilder::getConjuredHeapSymbolVal | ( | const Expr * | E, |
const LocationContext * | LCtx, | ||
QualType | type, | ||
unsigned | Count | ||
) |
Conjure a symbol representing heap allocated memory region.
Note, now, the expression doesn't need to represent a location. But the type need to!
Definition at line 222 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::conjureSymbol(), clang::ento::MemRegionManager::getSymbolicHeapRegion(), clang::ento::Loc::isLocType(), makeZeroVal(), MemMgr, SymMgr, clang::ast_matchers::type, and VisitCount.
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 214 of file SValBuilder.cpp.
References getConjuredHeapSymbolVal(), clang::Expr::getType(), and VisitCount.
Referenced by clang::ento::ExprEngine::bindReturnValue(), getConjuredHeapSymbolVal(), and clang::ento::ExprEngine::VisitCXXNewExpr().
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 std::nullopt
.
Definition at line 322 of file SValBuilder.cpp.
References clang::C, evalCast(), clang::Expr::EvaluateAsInt(), getConstantVal(), getContext(), getRegionManager(), clang::Stmt::getStmtClass(), clang::Expr::getType(), clang::Expr::IgnoreParens(), clang::Expr::isGLValue(), clang::ento::Loc::isLocType(), clang::Expr::isNullPointerConstant(), makeBoolVal(), makeIntVal(), makeLoc(), makeNullWithType(), makeTruthVal(), makeZeroVal(), clang::Expr::NPC_ValueDependentIsNotNull, and clang::Result.
Referenced by getConstantVal(), clang::ento::Environment::getSVal(), and clang::ento::ExprEngine::Visit().
|
inline |
Definition at line 136 of file SValBuilder.h.
References Context.
Referenced by clang::ento::ProgramState::assumeInBoundDual(), clang::ento::SimpleConstraintManager::assumeInternal(), collectSubRegionBindings(), compareValueToThreshold(), clang::ento::ExprEngine::computeObjectUnderConstruction(), evalIntegralCast(), getConstantVal(), getCXXThis(), getExistingLazyBinding(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), clang::ento::StoreManager::MakeElementRegion(), and clang::ento::ExprEngine::VisitCXXNewExpr().
|
inline |
Definition at line 137 of file SValBuilder.h.
References Context.
loc::MemRegionVal SValBuilder::getCXXThis | ( | const CXXMethodDecl * | D, |
const StackFrameContext * | SFC | ||
) |
Return a memory region for the 'this' object reference.
Definition at line 308 of file SValBuilder.cpp.
References getRegionManager(), and clang::CXXMethodDecl::getThisType().
Referenced by clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::CallEventManager::getCaller(), clang::ento::BlockCall::getInitialStackFrameContents(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), clang::ento::AnyCXXConstructorCall::getInitialStackFrameContents(), clang::ento::ExprEngine::getInitialState(), clang::ento::ExprEngine::ProcessBaseDtor(), clang::ento::ExprEngine::processCallExit(), clang::ento::ExprEngine::ProcessInitializer(), clang::ento::ExprEngine::ProcessMemberDtor(), and clang::ento::ExprEngine::VisitCommonDeclRefExpr().
loc::MemRegionVal SValBuilder::getCXXThis | ( | const CXXRecordDecl * | D, |
const StackFrameContext * | SFC | ||
) |
Return a memory region for the 'this' object reference.
Definition at line 315 of file SValBuilder.cpp.
References getContext(), clang::ASTContext::getPointerType(), getRegionManager(), and clang::TypeDecl::getTypeForDecl().
DefinedOrUnknownSVal SValBuilder::getDerivedRegionValueSymbolVal | ( | SymbolRef | parentSymbol, |
const TypedValueRegion * | region | ||
) |
Definition at line 251 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getDerivedSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::TypedValueRegion::getValueType(), clang::ento::Loc::isLocType(), clang::Type::isNullPtrType(), makeZeroVal(), MemMgr, and SymMgr.
Referenced by getDerivedSymbolForBinding().
DefinedSVal SValBuilder::getFunctionPointer | ( | const FunctionDecl * | func | ) |
Definition at line 285 of file SValBuilder.cpp.
References clang::ento::MemRegionManager::getFunctionCodeRegion(), and MemMgr.
Referenced by getMemberPointer(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), and clang::ento::ExprEngine::VisitMemberExpr().
|
pure virtual |
DefinedSVal SValBuilder::getMemberPointer | ( | const NamedDecl * | ND | ) |
Definition at line 269 of file SValBuilder.cpp.
References getFunctionPointer().
Referenced by clang::ento::ExprEngine::VisitCast(), and clang::ento::ExprEngine::VisitUnaryOperator().
DefinedSVal SValBuilder::getMetadataSymbolVal | ( | const void * | symbolTag, |
const MemRegion * | region, | ||
const Expr * | expr, | ||
QualType | type, | ||
const LocationContext * | LCtx, | ||
unsigned | count | ||
) |
Definition at line 234 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ast_matchers::expr, clang::ento::SymbolManager::getMetadataSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), MemMgr, SymMgr, and clang::ast_matchers::type.
|
inline |
Definition at line 155 of file SValBuilder.h.
References MemMgr.
Referenced by addParameterValuesToBindings(), clang::ento::ExprEngine::computeObjectUnderConstruction(), getConstantVal(), getCXXThis(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), clang::ento::ExprEngine::VisitCXXThisExpr(), and clang::ento::ExprEngine::VisitLambdaExpr().
|
inline |
Definition at line 156 of file SValBuilder.h.
References MemMgr.
DefinedOrUnknownSVal SValBuilder::getRegionValueSymbolVal | ( | const TypedValueRegion * | region | ) |
Make a unique symbol for value of region.
Definition at line 141 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::getRegionValueSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::TypedValueRegion::getValueType(), clang::ento::Loc::isLocType(), clang::Type::isNullPtrType(), makeZeroVal(), MemMgr, and SymMgr.
|
inline |
Definition at line 139 of file SValBuilder.h.
References StateMgr.
|
inline |
Definition at line 152 of file SValBuilder.h.
References SymMgr.
Referenced by doRearrangeUnchecked(), clang::ento::MemRegionManager::getStaticSize(), clang::ento::CheckerContext::getSymbolManager(), and clang::ento::SimpleConstraintManager::getSymbolManager().
|
inline |
Definition at line 153 of file SValBuilder.h.
References SymMgr.
|
inline |
Definition at line 263 of file SValBuilder.h.
References ArrayIndexTy, and BasicVals.
Referenced by clang::ento::ExprEngine::computeObjectUnderConstruction(), clang::ento::StoreManager::MakeElementRegion(), clang::ento::ExprEngine::ProcessDeleteDtor(), clang::ento::ExprEngine::VisitCXXNewExpr(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
nonloc::ConcreteInt SValBuilder::makeBoolVal | ( | const CXXBoolLiteralExpr * | boolean | ) |
Definition at line 136 of file SValBuilder.cpp.
References clang::CXXBoolLiteralExpr::getValue(), and makeTruthVal().
|
inline |
Definition at line 275 of file SValBuilder.h.
References clang::Expr::getType(), clang::ObjCBoolLiteralExpr::getValue(), and makeTruthVal().
Referenced by getConstantVal().
|
inline |
Definition at line 241 of file SValBuilder.h.
References BasicVals, clang::ento::BasicValueFactory::getCompoundValData(), and clang::ast_matchers::type.
Referenced by makeZeroVal(), processArgument(), and clang::ento::ExprEngine::VisitInitListExpr().
|
inline |
Definition at line 285 of file SValBuilder.h.
References BasicVals.
|
inline |
Definition at line 269 of file SValBuilder.h.
References BasicVals, clang::Expr::getType(), clang::APIntStorage::getValue(), and clang::Type::isUnsignedIntegerOrEnumerationType().
Referenced by assumeCollectionNonEmpty(), clang::ento::ExprEngine::bindReturnValue(), evalBinOp(), evalComplement(), clang::ento::ExprEngine::evalEagerlyAssumeBinOpBifurcation(), evalIntegralCast(), evalMinus(), getConstantVal(), getSimplifiedOffsets(), clang::ento::MemRegionManager::getStaticSize(), clang::ento::CheckerContext::isGreaterOrEqual(), clang::ento::CheckerContext::isNegative(), makeZeroVal(), mayBeSuccess(), populateObjCForDestinationSet(), clang::ento::ExprEngine::VisitCommonDeclRefExpr(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitLogicalExpr(), clang::ento::ExprEngine::VisitOffsetOfExpr(), and clang::ento::ExprEngine::VisitUnaryExprOrTypeTraitExpr().
Definition at line 289 of file SValBuilder.h.
References BasicVals.
|
inline |
Definition at line 281 of file SValBuilder.h.
References BasicVals.
Definition at line 300 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getIntValue().
|
inline |
Definition at line 293 of file SValBuilder.h.
References BasicVals, clang::ento::Loc::isLocType(), and clang::ast_matchers::type.
Definition at line 304 of file SValBuilder.h.
References BasicVals.
Referenced by clang::ento::ExprEngine::Visit().
|
inline |
Definition at line 245 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getLazyCompoundValData().
|
inline |
Definition at line 364 of file SValBuilder.h.
References clang::ast_matchers::expr.
|
inline |
Definition at line 368 of file SValBuilder.h.
References BasicVals.
|
inline |
Definition at line 360 of file SValBuilder.h.
|
inline |
Definition at line 356 of file SValBuilder.h.
References clang::ento::MemRegionManager::getSymbolicRegion(), and MemMgr.
Referenced by addParameterValuesToBindings(), clang::ento::ExprEngine::computeObjectUnderConstruction(), getConstantVal(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), clang::ento::StoreManager::getLValueVar(), makeSymbolVal(), and populateObjCForDestinationSet().
Definition at line 308 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getPersistentSValWithData().
nonloc::SymbolVal SValBuilder::makeNonLoc | ( | const llvm::APSInt & | rhs, |
BinaryOperator::Opcode | op, | ||
const SymExpr * | lhs, | ||
QualType | type | ||
) |
Definition at line 89 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getIntSymExpr(), clang::ento::Loc::isLocType(), SymMgr, and clang::ast_matchers::type.
nonloc::SymbolVal SValBuilder::makeNonLoc | ( | const SymExpr * | lhs, |
BinaryOperator::Opcode | op, | ||
const llvm::APSInt & | rhs, | ||
QualType | type | ||
) |
Definition at line 77 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getSymIntExpr(), clang::ento::Loc::isLocType(), SymMgr, and clang::ast_matchers::type.
Referenced by evalComplement(), evalIntegralCast(), evalMinus(), and makeSymExprValNN().
nonloc::SymbolVal SValBuilder::makeNonLoc | ( | const SymExpr * | lhs, |
BinaryOperator::Opcode | op, | ||
const SymExpr * | rhs, | ||
QualType | type | ||
) |
Definition at line 97 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getSymSymExpr(), clang::ento::Loc::isLocType(), SymMgr, and clang::ast_matchers::type.
nonloc::SymbolVal SValBuilder::makeNonLoc | ( | const SymExpr * | operand, |
QualType | fromTy, | ||
QualType | toTy | ||
) |
Create a NonLoc value for cast.
Definition at line 112 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getCastSymbol(), clang::ento::Loc::isLocType(), and SymMgr.
NonLoc SValBuilder::makeNonLoc | ( | const SymExpr * | operand, |
UnaryOperator::Opcode | op, | ||
QualType | type | ||
) |
Definition at line 105 of file SValBuilder.cpp.
References clang::ento::SymbolManager::getUnarySymExpr(), clang::ento::Loc::isLocType(), SymMgr, and clang::ast_matchers::type.
|
inline |
Create NULL pointer, with proper pointer bit-width for given address space.
type | pointer type. |
Definition at line 340 of file SValBuilder.h.
References BasicVals, Context, clang::ASTContext::getPointerType(), clang::ento::BasicValueFactory::getZeroWithTypeSize(), and clang::ast_matchers::type.
Referenced by getConstantVal(), makeZeroVal(), clang::ento::ExprEngine::VisitCast(), and clang::ento::ExprEngine::VisitUnaryOperator().
|
inline |
Definition at line 251 of file SValBuilder.h.
Referenced by clang::ento::ExprEngine::VisitCast().
|
inline |
Definition at line 255 of file SValBuilder.h.
|
inline |
Make an SVal that represents the given symbol.
This follows the convention of representing Loc-type symbols (symbolic pointers and references) as Loc values wrapping the symbol rather than as plain symbol values.
Definition at line 379 of file SValBuilder.h.
References clang::ento::SymExpr::getType(), clang::ento::Loc::isLocType(), and makeLoc().
Referenced by clang::ento::SMTConstraintManager::canReasonAbout(), and clang::ento::simplifyToSVal().
SVal SValBuilder::makeSymExprValNN | ( | BinaryOperator::Opcode | op, |
NonLoc | lhs, | ||
NonLoc | rhs, | ||
QualType | resultTy | ||
) |
Constructs a symbolic expression for two non-location values.
Definition at line 421 of file SValBuilder.cpp.
References AnOpts, clang::ento::SymExpr::computeComplexity(), clang::ento::SVal::getAs(), clang::ento::SVal::getAsSymbol(), and makeNonLoc().
|
inline |
Definition at line 333 of file SValBuilder.h.
References b, BasicVals, and clang::ento::BasicValueFactory::getTruthValue().
|
inline |
Definition at line 329 of file SValBuilder.h.
References b, BasicVals, clang::ento::BasicValueFactory::getTruthValue(), and clang::ast_matchers::type.
Referenced by getConstantVal(), makeBoolVal(), clang::ento::ExprEngine::VisitCast(), and clang::ento::ExprEngine::VisitIncrementDecrementOperator().
|
inline |
Definition at line 259 of file SValBuilder.h.
References ArrayIndexTy, and BasicVals.
Referenced by clang::ento::StoreManager::GetElementZeroRegion().
DefinedOrUnknownSVal SValBuilder::makeZeroVal | ( | QualType | type | ) |
Construct an SVal representing '0' for the specified type.
Definition at line 62 of file SValBuilder.cpp.
References BasicVals, clang::ento::BasicValueFactory::getEmptySValList(), clang::ento::Loc::isLocType(), makeCompoundVal(), makeIntVal(), makeNullWithType(), and clang::ast_matchers::type.
Referenced by conjureSymbolVal(), getConjuredHeapSymbolVal(), getConstantVal(), getDerivedRegionValueSymbolVal(), clang::ento::ExprEngine::getInitialState(), getRegionValueSymbolVal(), clang::ento::errno_modeling::setErrnoForStdFailure(), clang::ento::ExprEngine::VisitIncrementDecrementOperator(), clang::ento::ExprEngine::VisitInitListExpr(), and clang::ento::ExprEngine::VisitUnaryOperator().
|
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 clang::ento::ExprEngine::handleLValueBitCast(), and clang::ento::simplifyToSVal().
|
protected |
Definition at line 70 of file SValBuilder.h.
Referenced by getAnalyzerOptions(), and makeSymExprValNN().
|
protected |
The scalar type to use for array indices.
Definition at line 73 of file SValBuilder.h.
Referenced by convertToArrayIndex(), getArrayIndexType(), makeArrayIndex(), and makeZeroArrayIndex().
|
protected |
The width of the scalar type used for array indices.
Definition at line 76 of file SValBuilder.h.
Referenced by convertToArrayIndex().
|
protected |
Manager of APSInt values.
Definition at line 60 of file SValBuilder.h.
Referenced by getBasicValueFactory(), makeArrayIndex(), makeCompoundVal(), makeIntLocVal(), makeIntVal(), makeIntValWithWidth(), makeLazyCompoundVal(), makeLoc(), makeLocAsInteger(), makeNullWithType(), makeTruthVal(), makeZeroArrayIndex(), and makeZeroVal().
|
protected |
Definition at line 57 of file SValBuilder.h.
Referenced by evalComplement(), evalMinus(), getConditionType(), getContext(), and makeNullWithType().
|
protected |
Manages the creation of memory regions.
Definition at line 66 of file SValBuilder.h.
Referenced by conjureSymbolVal(), getBlockPointer(), getConjuredHeapSymbolVal(), getDerivedRegionValueSymbolVal(), getFunctionPointer(), getMetadataSymbolVal(), getRegionManager(), getRegionValueSymbolVal(), and makeLoc().
|
protected |
Definition at line 68 of file SValBuilder.h.
Referenced by getCastedMemRegionVal(), and getStateManager().
|
protected |
Manages the creation of symbols.
Definition at line 63 of file SValBuilder.h.
Referenced by conjureSymbol(), conjureSymbolVal(), getConjuredHeapSymbolVal(), getDerivedRegionValueSymbolVal(), getMetadataSymbolVal(), getRegionValueSymbolVal(), getSymbolManager(), and makeNonLoc().