15 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H 16 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H 25 #include "llvm/ADT/APSInt.h" 26 #include "llvm/ADT/FoldingSet.h" 27 #include "llvm/ADT/ImmutableList.h" 28 #include "llvm/ADT/iterator_range.h" 29 #include "llvm/Support/Allocator.h" 36 class CXXBaseSpecifier;
43 llvm::ImmutableList<SVal> L;
50 using iterator = llvm::ImmutableList<SVal>::iterator;
56 llvm::ImmutableList<SVal> L);
67 : store(st), region(r) {
74 static void Profile(llvm::FoldingSetNodeID&
ID,
83 llvm::ImmutableList<const CXXBaseSpecifier *> L;
87 llvm::ImmutableList<const CXXBaseSpecifier *> L)
90 using iterator = llvm::ImmutableList<const CXXBaseSpecifier *>::iterator;
96 llvm::ImmutableList<const CXXBaseSpecifier *> L);
108 llvm::FoldingSet<llvm::FoldingSetNodeWrapper<llvm::APSInt>>;
111 llvm::BumpPtrAllocator& BPAlloc;
113 APSIntSetTy APSIntSet;
114 void *PersistentSVals =
nullptr;
115 void *PersistentSValPairs =
nullptr;
117 llvm::ImmutableList<SVal>::Factory SValListFactory;
118 llvm::ImmutableList<const CXXBaseSpecifier *>::Factory CXXBaseListFactory;
119 llvm::FoldingSet<CompoundValData> CompoundValDataSet;
120 llvm::FoldingSet<LazyCompoundValData> LazyCompoundValDataSet;
121 llvm::FoldingSet<PointerToMemberData> PointerToMemberDataSet;
129 : Ctx(ctx), BPAlloc(Alloc), SValListFactory(Alloc),
130 CXXBaseListFactory(Alloc) {}
180 return getValue(getAPSIntType(T).getMaxValue());
184 return getValue(getAPSIntType(T).getMinValue());
222 llvm::ImmutableList<SVal> Vals);
229 llvm::ImmutableList<const CXXBaseSpecifier *> L);
232 return SValListFactory.getEmptyList();
236 return SValListFactory.add(X, L);
240 return CXXBaseListFactory.getEmptyList();
245 llvm::ImmutableList<const CXXBaseSpecifier *> L) {
246 return CXXBaseListFactory.add(CBS, L);
250 llvm::iterator_range<CastExpr::path_const_iterator> PathRange,
257 const std::pair<SVal, uintptr_t>&
260 const std::pair<SVal, SVal>&
261 getPersistentSValPair(
const SVal& V1,
const SVal& V2);
263 const SVal* getPersistentSVal(
SVal X);
270 #endif // LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H
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.
bool isUnsignedIntegerOrEnumerationType() const
Determines whether this is an integer type that is unsigned or an enumeration types whose underlying ...
llvm::ImmutableList< const CXXBaseSpecifier * > getCXXBaseList() const
const llvm::APSInt & getMaxValue(QualType T)
const void * getStore() const
C Language Family Type Representation.
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)
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)
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 llvm::APSInt & getIntWithPtrWidth(uint64_t X, bool isUnsigned)
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
ASTContext & getContext() const
static SVal getValue(SVal val, SValBuilder &svalBuilder)
const TypedValueRegion * getRegion() const
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