16 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H 17 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H 38 iterator
begin()
const {
return L.begin(); }
39 iterator
end()
const {
return L.end(); }
52 : store(st), region(r) {
59 static void Profile(llvm::FoldingSetNodeID&
ID,
76 iterator
begin()
const {
return L.begin(); }
77 iterator
end()
const {
return L.end(); }
90 typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<llvm::APSInt> >
94 llvm::BumpPtrAllocator& BPAlloc;
96 APSIntSetTy APSIntSet;
97 void * PersistentSVals;
98 void * PersistentSValPairs;
102 llvm::FoldingSet<CompoundValData> CompoundValDataSet;
103 llvm::FoldingSet<LazyCompoundValData> LazyCompoundValDataSet;
104 llvm::FoldingSet<PointerToMemberData> PointerToMemberDataSet;
108 const llvm::APSInt&
getValue(uint64_t
X,
unsigned BitWidth,
bool isUnsigned);
112 : Ctx(ctx), BPAlloc(Alloc), PersistentSVals(nullptr),
113 PersistentSValPairs(nullptr), SValListFactory(Alloc),
114 CXXBaseListFactory(Alloc) {}
120 const llvm::APSInt&
getValue(
const llvm::APSInt& X);
121 const llvm::APSInt&
getValue(
const llvm::APInt& X,
bool isUnsigned);
133 const llvm::APSInt &
Convert(
const llvm::APSInt& To,
134 const llvm::APSInt& From) {
164 return getValue(getAPSIntType(T).getMaxValue());
168 return getValue(getAPSIntType(T).getMinValue());
171 inline const llvm::APSInt&
Add1(
const llvm::APSInt& V) {
177 inline const llvm::APSInt&
Sub1(
const llvm::APSInt& V) {
215 return SValListFactory.getEmptyList();
219 return SValListFactory.add(X, L);
223 return CXXBaseListFactory.getEmptyList();
229 return CXXBaseListFactory.add(CBS, L);
233 llvm::iterator_range<CastExpr::path_const_iterator> PathRange,
237 const llvm::APSInt& V1,
238 const llvm::APSInt& V2);
240 const std::pair<SVal, uintptr_t>&
243 const std::pair<SVal, SVal>&
244 getPersistentSValPair(
const SVal& V1,
const SVal& V2);
246 const SVal* getPersistentSVal(
SVal X);
Defines the clang::ASTContext interface.
const llvm::APSInt & Convert(QualType T, const llvm::APSInt &From)
TypedValueRegion - An abstract class representing regions having a typed value.
A (possibly-)qualified type.
llvm::ImmutableList< const CXXBaseSpecifier * > getCXXBaseList() const
const llvm::APSInt & getMaxValue(QualType T)
const void * getStore() const
const llvm::APSInt & getTruthValue(bool b)
virtual QualType getValueType() const =0
const llvm::APSInt & getZeroWithTypeSize(QualType T)
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
LazyCompoundValData(const StoreRef &st, const TypedValueRegion *r)
const llvm::APSInt & Add1(const llvm::APSInt &V)
const llvm::APSInt & getTruthValue(bool b, QualType T)
llvm::ImmutableList< const CXXBaseSpecifier * >::iterator iterator
const DeclaratorDecl * getDeclaratorDecl() const
const llvm::APSInt & getMinValue(QualType T)
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
Value representing pointer-to-member.
static bool isCompoundType(QualType T)
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
const llvm::APSInt & 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 sign...
llvm::ImmutableList< SVal > prependSVal(SVal X, llvm::ImmutableList< SVal > L)
void Profile(llvm::FoldingSetNodeID &ID)
static bool isLocType(QualType T)
llvm::ImmutableList< SVal >::iterator iterator
A record of the "type" of an APSInt, used for conversions.
bool isScalarType() const
const llvm::APSInt & getIntValue(uint64_t X, bool isUnsigned)
Represents a ValueDecl that came out of a declarator.
void Profile(llvm::FoldingSetNodeID &ID)
const FunctionProtoType * T
const llvm::APSInt & getIntWithPtrWidth(uint64_t X, bool isUnsigned)
ASTContext & getContext() const
static SVal getValue(SVal val, SValBuilder &svalBuilder)
const TypedValueRegion * getRegion() const
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
llvm::ImmutableList< const CXXBaseSpecifier * > getEmptyCXXBaseList()
llvm::ImmutableList< const CXXBaseSpecifier * > prependCXXBase(const CXXBaseSpecifier *CBS, llvm::ImmutableList< const CXXBaseSpecifier *> L)
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
bool isSignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is signed or an enumeration types whose underlying ty...
const llvm::APSInt & Sub1(const llvm::APSInt &V)
const llvm::APSInt & getZeroWithPtrWidth(bool isUnsigned=true)
llvm::APSInt convert(const llvm::APSInt &Value) const LLVM_READONLY
Convert and return a new APSInt with the given value, but this type's bit width and signedness...
Dataflow Directional Tag Classes.
static void Profile(llvm::FoldingSetNodeID &ID, QualType T, llvm::ImmutableList< SVal > L)
const llvm::APSInt & getMinValue(const llvm::APSInt &v)
unsigned getIntWidth(QualType T) const
APSIntType getAPSIntType(QualType T) const
Returns the type of the APSInt used to store values of the given QualType.
void Profile(llvm::FoldingSetNodeID &ID)
Represents a base class of a C++ class.
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
BasicValueFactory(ASTContext &ctx, llvm::BumpPtrAllocator &Alloc)
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
PointerToMemberData(const DeclaratorDecl *D, llvm::ImmutableList< const CXXBaseSpecifier *> L)
const llvm::APSInt & getMaxValue(const llvm::APSInt &v)
CompoundValData(QualType t, llvm::ImmutableList< SVal > l)
llvm::ImmutableList< SVal > getEmptySValList()
CanQualType UnsignedIntTy