clang 20.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 541 of file SValBuilder.cpp.
References evalEQ().
Referenced by clang::ento::ProgramState::areEqual(), and wasRegionOfInterestModifiedAt().
|
inline |
Definition at line 182 of file SValBuilder.h.
References clang::ento::SymbolManager::conjureSymbol(), clang::ast_matchers::expr, and SymMgr.
|
inline |
Definition at line 174 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 191 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, | ||
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 154 of file SValBuilder.cpp.
References conjureSymbolVal(), clang::LocationContext::getAnalysisDeclContext(), clang::AnalysisDeclContext::getASTContext(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::Expr::isGLValue(), clang::Type::isNullPtrType(), makeZeroVal(), and clang::T.
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().
DefinedOrUnknownSVal SValBuilder::conjureSymbolVal | ( | const void * | symbolTag, |
const Stmt * | S, | ||
const LocationContext * | LCtx, | ||
QualType | type, | ||
unsigned | count | ||
) |
Definition at line 172 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SymbolManager::conjureSymbol(), clang::ento::MemRegionManager::getSymbolicRegion(), clang::ento::Loc::isLocType(), makeZeroVal(), MemMgr, SymMgr, and clang::ast_matchers::type.
Definition at line 117 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 491 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(), computeOffset(), doRearrangeUnchecked(), evalBinOp(), evalIntegralCast(), getIndex(), 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 1102 of file SValBuilder.cpp.
References V.
Referenced by clang::ento::SimpleConstraintManager::assumeInternal(), castArgToParamTypeIfNeeded(), convertToArrayIndex(), evalIntegralCast(), getConstantVal(), clang::ento::CXXInstanceCall::getCXXThisVal(), 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 466 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 550 of file SValBuilder.cpp.
References clang::ento::SVal::castAs(), and evalEQ().
SVal SValBuilder::evalEQ | ( | ProgramStateRef | state, |
SVal | lhs, | ||
SVal | rhs | ||
) |
Definition at line 546 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 593 of file SValBuilder.cpp.
References clang::ento::SVal::castAs(), evalBinOpNN(), evalCast(), clang::ento::SVal::getAs(), 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 454 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 478 of file SValBuilder.cpp.
References evalComplement(), evalMinus(), and clang::ento::SVal::getAs().
loc::MemRegionVal SValBuilder::getAllocaRegionVal | ( | const Expr * | E, |
const LocationContext * | LCtx, | ||
unsigned | Count | ||
) |
Create an SVal representing the result of an alloca()-like call, that is, an AllocaRegion on the stack.
After calling this function, it's a good idea to set the extent of the returned AllocaRegion.
Definition at line 232 of file SValBuilder.cpp.
References E, clang::ento::MemRegionManager::getAllocaRegion(), getRegionManager(), and VisitCount.
|
inline |
|
inline |
Definition at line 157 of file SValBuilder.h.
References ArrayIndexTy.
Referenced by clang::ento::ProgramState::assumeInBoundDual(), clang::ento::ExprEngine::bindReturnValue(), computeOffset(), and clang::ento::MemRegionManager::getStaticSize().
|
inline |
Definition at line 161 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(), getStartIndex(), isInRelation(), isWithinConstantOverflowBounds(), and processArgument().
|
inline |
Definition at line 162 of file SValBuilder.h.
References BasicVals.
DefinedSVal SValBuilder::getBlockPointer | ( | const BlockDecl * | block, |
CanQualType | locTy, | ||
const LocationContext * | locContext, | ||
unsigned | blockCount | ||
) |
Definition at line 295 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 307 of file SValBuilder.cpp.
References clang::ento::StoreManager::castRegion(), clang::ento::ProgramStateManager::getStoreManager(), and StateMgr.
|
inline |
Definition at line 153 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().
DefinedSVal 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 216 of file SValBuilder.cpp.
References clang::ento::SymbolManager::canSymbolicate(), clang::ento::SVal::castAs(), clang::ento::SymbolManager::conjureSymbol(), E, clang::ento::MemRegionManager::getSymbolicHeapRegion(), clang::ento::Loc::isLocType(), makeZeroVal(), MemMgr, SymMgr, clang::ast_matchers::type, and VisitCount.
DefinedSVal 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 209 of file SValBuilder.cpp.
References E, getConjuredHeapSymbolVal(), clang::Expr::getType(), clang::T, 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 328 of file SValBuilder.cpp.
References clang::C, E, 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 148 of file SValBuilder.h.
References Context.
Referenced by clang::ento::ProgramState::assumeInBoundDual(), clang::ento::SimpleConstraintManager::assumeInternal(), bindRequiredArrayElementToEnvironment(), collectSubRegionBindings(), clang::ento::ExprEngine::computeObjectUnderConstruction(), computeOffset(), evalIntegralCast(), getConstantVal(), getCXXThis(), clang::ento::CXXInstanceCall::getCXXThisVal(), getExistingLazyBinding(), getIndex(), clang::ento::CXXInstanceCall::getInitialStackFrameContents(), isUnsigned(), clang::ento::StoreManager::MakeElementRegion(), and clang::ento::ExprEngine::VisitCXXNewExpr().
|
inline |
Definition at line 149 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 314 of file SValBuilder.cpp.
References D, and getRegionManager().
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 321 of file SValBuilder.cpp.
References D, getContext(), clang::ASTContext::getPointerType(), getRegionManager(), and clang::T.
DefinedOrUnknownSVal SValBuilder::getDerivedRegionValueSymbolVal | ( | SymbolRef | parentSymbol, |
const TypedValueRegion * | region | ||
) |
Definition at line 257 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, SymMgr, and clang::T.
Referenced by getDerivedSymbolForBinding().
DefinedSVal SValBuilder::getFunctionPointer | ( | const FunctionDecl * | func | ) |
Definition at line 291 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 |
Evaluates a given SVal.
If the SVal has only one possible (integer) value, that value is returned. Otherwise, returns NULL.
Referenced by getKnownValue().
|
pure virtual |
Tries to get the maximal possible (integer) value of a given SVal.
This always returns the value of a ConcreteInt, but may return NULL if the value is symbolic and the constraint manager cannot provide a useful answer.
Referenced by isNegative().
DefinedSVal SValBuilder::getMemberPointer | ( | const NamedDecl * | ND | ) |
Definition at line 275 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 240 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.
|
pure virtual |
Tries to get the minimal possible (integer) value of a given SVal.
This always returns the value of a ConcreteInt, but may return NULL if the value is symbolic and the constraint manager cannot provide a useful answer.
|
inline |
Definition at line 167 of file SValBuilder.h.
References MemMgr.
Referenced by addParameterValuesToBindings(), bindRequiredArrayElementToEnvironment(), clang::ento::ExprEngine::computeObjectUnderConstruction(), getAllocaRegionVal(), getConstantVal(), getCXXThis(), clang::ento::ObjCMethodCall::getInitialStackFrameContents(), clang::ento::ExprEngine::VisitCXXThisExpr(), and clang::ento::ExprEngine::VisitLambdaExpr().
|
inline |
Definition at line 168 of file SValBuilder.h.
References MemMgr.
DefinedOrUnknownSVal SValBuilder::getRegionValueSymbolVal | ( | const TypedValueRegion * | region | ) |
Make a unique symbol for value of region.
Definition at line 137 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, SymMgr, and clang::T.
|
inline |
Definition at line 151 of file SValBuilder.h.
References StateMgr.
|
inline |
Definition at line 164 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 165 of file SValBuilder.h.
References SymMgr.
|
inline |
Definition at line 282 of file SValBuilder.h.
References ArrayIndexTy, and BasicVals.
Referenced by clang::ento::ExprEngine::computeObjectUnderConstruction(), computeOffset(), escapeByStartIndexAndCount(), 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 132 of file SValBuilder.cpp.
References clang::CXXBoolLiteralExpr::getValue(), and makeTruthVal().
|
inline |
Definition at line 294 of file SValBuilder.h.
References clang::Expr::getType(), clang::ObjCBoolLiteralExpr::getValue(), and makeTruthVal().
Referenced by getConstantVal().
|
inline |
Definition at line 260 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 304 of file SValBuilder.h.
References BasicVals.
|
inline |
Definition at line 288 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::evalEagerlyAssumeBifurcation(), evalIntegralCast(), evalMinus(), getConstantVal(), getIndex(), 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 308 of file SValBuilder.h.
References BasicVals, and isUnsigned().
|
inline |
Definition at line 300 of file SValBuilder.h.
References BasicVals.
Definition at line 319 of file SValBuilder.h.
References BasicVals, clang::ento::BasicValueFactory::getIntValue(), and isUnsigned().
|
inline |
Definition at line 312 of file SValBuilder.h.
References BasicVals, clang::ento::Loc::isLocType(), and clang::ast_matchers::type.
Definition at line 323 of file SValBuilder.h.
References BasicVals.
Referenced by clang::ento::ExprEngine::Visit().
|
inline |
Definition at line 264 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getLazyCompoundValData().
|
inline |
Definition at line 382 of file SValBuilder.h.
References clang::ast_matchers::expr.
|
inline |
Definition at line 386 of file SValBuilder.h.
References BasicVals.
|
inline |
Definition at line 378 of file SValBuilder.h.
|
inline |
Definition at line 374 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 327 of file SValBuilder.h.
References BasicVals, and clang::ento::BasicValueFactory::getPersistentSValWithData().
nonloc::SymbolVal SValBuilder::makeNonLoc | ( | APSIntPtr | rhs, |
BinaryOperator::Opcode | op, | ||
const SymExpr * | lhs, | ||
QualType | type | ||
) |
Definition at line 85 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, | ||
APSIntPtr | 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 93 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 108 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 101 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 358 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 270 of file SValBuilder.h.
Referenced by clang::ento::ExprEngine::VisitCast().
|
inline |
Definition at line 274 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 397 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 427 of file SValBuilder.cpp.
References AnOpts, clang::ento::SymExpr::computeComplexity(), clang::ento::SVal::getAs(), clang::ento::SVal::getAsSymbol(), and makeNonLoc().
|
inline |
Definition at line 351 of file SValBuilder.h.
References b, BasicVals, and clang::ento::BasicValueFactory::getTruthValue().
|
inline |
Definition at line 347 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 278 of file SValBuilder.h.
References ArrayIndexTy, and BasicVals.
Referenced by computeOffset(), and 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().