16 #ifndef LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H
17 #define LLVM_CLANG_STATICANALYZER_CORE_PATHSENSITIVE_BASICVALUEFACTORY_H
50 : store(st), region(r) {}
55 static void Profile(llvm::FoldingSetNodeID&
ID,
63 typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<llvm::APSInt> >
67 llvm::BumpPtrAllocator& BPAlloc;
69 APSIntSetTy APSIntSet;
70 void * PersistentSVals;
71 void * PersistentSValPairs;
74 llvm::FoldingSet<CompoundValData> CompoundValDataSet;
75 llvm::FoldingSet<LazyCompoundValData> LazyCompoundValDataSet;
79 const llvm::APSInt& getValue(uint64_t
X,
unsigned BitWidth,
bool isUnsigned);
83 : Ctx(ctx), BPAlloc(Alloc), PersistentSVals(nullptr),
84 PersistentSValPairs(nullptr), SValListFactory(Alloc) {}
90 const llvm::APSInt& getValue(
const llvm::APSInt& X);
91 const llvm::APSInt& getValue(
const llvm::APInt& X,
bool isUnsigned);
92 const llvm::APSInt& getValue(uint64_t X,
QualType T);
103 const llvm::APSInt &
Convert(
const llvm::APSInt& To,
104 const llvm::APSInt& From) {
109 return getValue(TargetType.
convert(From));
117 return getValue(TargetType.
convert(From));
122 return getValue(X, T);
141 inline const llvm::APSInt&
Add1(
const llvm::APSInt& V) {
147 inline const llvm::APSInt&
Sub1(
const llvm::APSInt& V) {
162 return getValue(b ? 1 : 0, Ctx.
getTypeSize(T),
false);
176 return SValListFactory.getEmptyList();
180 return SValListFactory.add(X, L);
184 const llvm::APSInt& V1,
185 const llvm::APSInt& V2);
187 const std::pair<SVal, uintptr_t>&
190 const std::pair<SVal, SVal>&
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.
const llvm::APSInt & getMaxValue(QualType T)
const CompoundValData * getCompoundValData(QualType T, llvm::ImmutableList< SVal > Vals)
const std::pair< SVal, SVal > & getPersistentSValPair(const SVal &V1, const SVal &V2)
const llvm::APSInt & getTruthValue(bool b)
LazyCompoundValData(const StoreRef &st, const TypedValueRegion *r)
const llvm::APSInt & Add1(const llvm::APSInt &V)
const llvm::APSInt & getTruthValue(bool b, QualType T)
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
const void * getStore() const
ASTContext & getContext() 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 ...
llvm::ImmutableList< SVal > consVals(SVal X, llvm::ImmutableList< SVal > L)
const llvm::APSInt & Convert(const llvm::APSInt &To, const llvm::APSInt &From)
static bool isLocType(QualType T)
llvm::ImmutableList< SVal >::iterator iterator
A record of the "type" of an APSInt, used for conversions.
const SVal * getPersistentSVal(SVal X)
const TypedValueRegion * getRegion() const
const llvm::APSInt & getIntValue(uint64_t X, bool isUnsigned)
QualType getLogicalOperationType() const
The result type of logical operations, '<', '>', '!=', etc.
void Profile(llvm::FoldingSetNodeID &ID)
ID
Defines the set of possible language-specific address spaces.
bool isSignedIntegerOrEnumerationType() const
const llvm::APSInt & getIntWithPtrWidth(uint64_t X, bool isUnsigned)
static void Profile(llvm::FoldingSetNodeID &ID, const StoreRef &store, const TypedValueRegion *region)
bool isIntegralOrEnumerationType() const
Determine whether this type is an integral or enumeration type.
const llvm::APSInt & Sub1(const llvm::APSInt &V)
const llvm::APSInt & getZeroWithPtrWidth(bool isUnsigned=true)
const llvm::APSInt * evalAPSInt(BinaryOperator::Opcode Op, const llvm::APSInt &V1, const llvm::APSInt &V2)
llvm::APSInt convert(const llvm::APSInt &Value) const LLVM_READONLY
static void Profile(llvm::FoldingSetNodeID &ID, QualType T, llvm::ImmutableList< SVal > L)
const llvm::APSInt & getMinValue(const llvm::APSInt &v)
void Profile(llvm::FoldingSetNodeID &ID)
BasicValueFactory(ASTContext &ctx, llvm::BumpPtrAllocator &Alloc)
const std::pair< SVal, uintptr_t > & getPersistentSValWithData(const SVal &V, uintptr_t Data)
const LazyCompoundValData * getLazyCompoundValData(const StoreRef &store, const TypedValueRegion *region)
const llvm::APSInt & getMaxValue(const llvm::APSInt &v)
APSIntType getAPSIntType(QualType T) const
Returns the type of the APSInt used to store values of the given QualType.
CompoundValData(QualType t, llvm::ImmutableList< SVal > l)
llvm::ImmutableList< SVal > getEmptySValList()
CanQualType UnsignedIntTy