15 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SVALBUILDER_H
16 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_SVALBUILDER_H
27 class CXXBoolLiteralExpr;
32 virtual void anchor();
149 const void *symbolTag =
nullptr) {
156 const void *symbolTag =
nullptr) {
185 unsigned visitCount);
197 const void *symbolTag,
const MemRegion *region,
204 unsigned blockCount);
327 ProgramStateManager &stateMgr);
Defines the clang::ASTContext interface.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
TypedValueRegion - An abstract class representing regions having a typed value.
nonloc::ConcreteInt makeIntVal(const IntegerLiteral *integer)
DefinedSVal getBlockPointer(const BlockDecl *block, CanQualType locTy, const LocationContext *locContext, unsigned blockCount)
SymbolManager & getSymbolManager()
MemRegion - The root abstract class for all memory regions.
QualType getArrayIndexType() const
const CompoundValData * getCompoundValData(QualType T, llvm::ImmutableList< SVal > Vals)
SValBuilder * createSimpleSValBuilder(llvm::BumpPtrAllocator &alloc, ASTContext &context, ProgramStateManager &stateMgr)
const internal::VariadicAllOfMatcher< Stmt > stmt
Matches statements.
SVal makeSymExprValNN(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs, QualType resultTy)
Constructs a symbolic expression for two non-location values.
ProgramStateManager & StateMgr
SVal evalCast(SVal val, QualType castTy, QualType originalType)
Value representing integer constant.
MemRegionManager MemMgr
Manages the creation of memory regions.
const SymbolManager & getSymbolManager() const
const llvm::APSInt & getTruthValue(bool b, QualType T)
virtual SVal dispatchCast(SVal val, QualType castTy)=0
loc::MemRegionVal getCXXThis(const CXXMethodDecl *D, const StackFrameContext *SFC)
Return a memory region for the 'this' object reference.
NonLoc makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op, const llvm::APSInt &rhs, QualType type)
NonLoc makeArrayIndex(uint64_t idx)
BasicValueFactory BasicVals
Manager of APSInt values.
Symbolic value. These values used to capture symbolic execution of the program.
virtual SVal evalCastFromNonLoc(NonLoc val, QualType castTy)=0
virtual SVal evalBinOpLN(ProgramStateRef state, BinaryOperator::Opcode op, Loc lhs, NonLoc rhs, QualType resultTy)=0
MemRegionManager & getRegionManager()
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
DefinedOrUnknownSVal getDerivedRegionValueSymbolVal(SymbolRef parentSymbol, const TypedValueRegion *region)
const SymbolicRegion * getSymbolicRegion(SymbolRef Sym)
Retrieve or create a "symbolic" memory region.
static bool isLocType(QualType T)
const LangOptions & getLangOpts() const
DefinedOrUnknownSVal getRegionValueSymbolVal(const TypedValueRegion *region)
Make a unique symbol for value of region.
Loc makeLoc(const MemRegion *region)
Loc makeLoc(const AddrLabelExpr *expr)
loc::ConcreteInt makeIntLocVal(const llvm::APSInt &integer)
NonLoc makeCompoundVal(QualType type, llvm::ImmutableList< SVal > vals)
DefinedSVal getFunctionPointer(const FunctionDecl *func)
NonLoc makeIntValWithPtrWidth(uint64_t integer, bool isUnsigned)
bool haveSameType(QualType Ty1, QualType Ty2)
const llvm::APSInt & getIntValue(uint64_t X, bool isUnsigned)
virtual QualType getType() const =0
llvm::APInt getValue() const
nonloc::ConcreteInt makeBoolVal(const ObjCBoolLiteralExpr *boolean)
Loc makeLoc(SymbolRef sym)
DefinedOrUnknownSVal makeZeroVal(QualType type)
Construct an SVal representing '0' for the specified type.
virtual SVal evalMinus(NonLoc val)=0
const llvm::APSInt & getIntWithPtrWidth(uint64_t X, bool isUnsigned)
nonloc::ConcreteInt makeTruthVal(bool b)
const QualType ArrayIndexTy
The scalar type to use for array indices.
virtual SVal evalBinOpLL(ProgramStateRef state, BinaryOperator::Opcode op, Loc lhs, Loc rhs, QualType resultTy)=0
SVal evalBinOp(ProgramStateRef state, BinaryOperator::Opcode op, SVal lhs, SVal rhs, QualType type)
nonloc::ConcreteInt makeIntVal(const llvm::APSInt &integer)
QualType getConditionType() const
bool isUnsignedIntegerOrEnumerationType() const
NonLoc makeZeroArrayIndex()
NonLoc makeIntVal(uint64_t integer, bool isUnsigned)
const ASTContext & getContext() const
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
SymbolManager SymMgr
Manages the creation of symbols.
DefinedOrUnknownSVal conjureSymbolVal(const void *symbolTag, const Expr *expr, const LocationContext *LCtx, unsigned count)
Create a new symbol with a unique 'name'.
virtual SVal evalCastFromLoc(Loc val, QualType castTy)=0
Represents a static or instance method of a struct/union/class.
ASTContext & getContext()
const MemRegionManager & getRegionManager() const
const BasicValueFactory & getBasicValueFactory() const
const llvm::APSInt & getZeroWithPtrWidth(bool isUnsigned=true)
DefinedOrUnknownSVal getConjuredHeapSymbolVal(const Expr *E, const LocationContext *LCtx, unsigned Count)
Conjure a symbol representing heap allocated memory region.
virtual SVal evalBinOpNN(ProgramStateRef state, BinaryOperator::Opcode op, NonLoc lhs, NonLoc rhs, QualType resultTy)=0
const unsigned ArrayIndexWidth
The width of the scalar type used for array indices.
AddrLabelExpr - The GNU address of label extension, representing &&label.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
NonLoc makeIntVal(const llvm::APInt &integer, bool isUnsigned)
const SymbolConjured * conjureSymbol(const Stmt *stmt, const LocationContext *LCtx, QualType type, unsigned visitCount, const void *symbolTag=nullptr)
NonLoc makeLocAsInteger(Loc loc, unsigned bits)
ProgramStateManager & getStateManager()
DefinedSVal getMetadataSymbolVal(const void *symbolTag, const MemRegion *region, const Expr *expr, QualType type, unsigned count)
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
SVal convertToArrayIndex(SVal val)
const SymbolConjured * conjureSymbol(const Stmt *E, const LocationContext *LCtx, QualType T, unsigned VisitCount, const void *SymbolTag=nullptr)
BasicValueFactory & getBasicValueFactory()
Loc makeLoc(const llvm::APSInt &integer)
SValBuilder(llvm::BumpPtrAllocator &alloc, ASTContext &context, ProgramStateManager &stateMgr)
LabelDecl * getLabel() const
const std::pair< SVal, uintptr_t > & getPersistentSValWithData(const SVal &V, uintptr_t Data)
bool haveSameType(const SymExpr *Sym1, const SymExpr *Sym2)
const LazyCompoundValData * getLazyCompoundValData(const StoreRef &store, const TypedValueRegion *region)
Represents a C++ struct/union/class.
DefinedOrUnknownSVal evalEQ(ProgramStateRef state, DefinedOrUnknownSVal lhs, DefinedOrUnknownSVal rhs)
virtual SVal evalComplement(NonLoc val)=0
Optional< SVal > getConstantVal(const Expr *E)
const SymbolConjured * conjureSymbol(const Expr *expr, const LocationContext *LCtx, unsigned visitCount, const void *symbolTag=nullptr)
virtual const llvm::APSInt * getKnownValue(ProgramStateRef state, SVal val)=0
nonloc::ConcreteInt makeTruthVal(bool b, QualType type)
DefinedSVal makeIntVal(uint64_t integer, QualType type)
NonLoc makeLazyCompoundVal(const StoreRef &store, const TypedValueRegion *region)
A boolean literal, per ([C++ lex.bool] Boolean literals).