20 using namespace clang;
26 ID.AddPointer(L.getInternalPointer());
33 ID.AddPointer(region);
40 ID.AddPointer(L.getInternalPointer());
50 ID.AddPointer( (
void*) X.second);
62 typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<SValData> >
65 typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<SValPair> >
72 for (APSIntSetTy::iterator
I=APSIntSet.begin(),
E=APSIntSet.end();
I!=
E; ++
I)
73 I->getValue().~APSInt();
79 const llvm::APSInt& BasicValueFactory::getValue(
const llvm::APSInt&
X) {
80 llvm::FoldingSetNodeID
ID;
82 typedef llvm::FoldingSetNodeWrapper<llvm::APSInt> FoldNodeTy;
85 FoldNodeTy*
P = APSIntSet.FindNodeOrInsertPos(ID, InsertPos);
88 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
89 new (
P) FoldNodeTy(X);
90 APSIntSet.InsertNode(P, InsertPos);
96 const llvm::APSInt& BasicValueFactory::getValue(
const llvm::APInt&
X,
98 llvm::APSInt V(X, isUnsigned);
102 const llvm::APSInt& BasicValueFactory::getValue(uint64_t
X,
unsigned BitWidth,
104 llvm::APSInt V(BitWidth, isUnsigned);
109 const llvm::APSInt& BasicValueFactory::getValue(uint64_t
X,
QualType T) {
118 llvm::FoldingSetNodeID
ID;
122 CompoundValData* D = CompoundValDataSet.FindNodeOrInsertPos(ID, InsertPos);
127 CompoundValDataSet.InsertNode(D, InsertPos);
136 llvm::FoldingSetNodeID
ID;
141 LazyCompoundValDataSet.FindNodeOrInsertPos(ID, InsertPos);
146 LazyCompoundValDataSet.InsertNode(D, InsertPos);
154 llvm::FoldingSetNodeID
ID;
159 PointerToMemberDataSet.FindNodeOrInsertPos(ID, InsertPos);
164 PointerToMemberDataSet.InsertNode(D, InsertPos);
171 llvm::iterator_range<CastExpr::path_const_iterator> PathRange,
181 PathList = CXXBaseListFactory.getEmptyList();
190 for (
const auto &
I : llvm::reverse(PathRange))
197 const llvm::APSInt& V1,
const llvm::APSInt& V2) {
201 assert (
false &&
"Invalid Opcode.");
204 return &getValue( V1 * V2 );
209 return &getValue( V1 / V2 );
214 return &getValue( V1 % V2 );
217 return &getValue( V1 + V2 );
220 return &getValue( V1 - V2 );
229 if (V2.isSigned() && V2.isNegative())
232 uint64_t Amt = V2.getZExtValue();
234 if (Amt >= V1.getBitWidth())
237 return &getValue( V1.operator<<( (
unsigned) Amt ));
247 if (V2.isSigned() && V2.isNegative())
250 uint64_t Amt = V2.getZExtValue();
252 if (Amt >= V1.getBitWidth())
255 return &getValue( V1.operator>>( (
unsigned) Amt ));
279 return &getValue( V1 & V2 );
282 return &getValue( V1 | V2 );
285 return &getValue( V1 ^ V2 );
290 const std::pair<SVal, uintptr_t>&
296 llvm::FoldingSetNodeID
ID;
299 ID.AddPointer((
void*) Data);
303 typedef llvm::FoldingSetNodeWrapper<SValData> FoldNodeTy;
304 FoldNodeTy*
P = Map.FindNodeOrInsertPos(ID, InsertPos);
307 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
308 new (
P) FoldNodeTy(std::make_pair(V, Data));
309 Map.InsertNode(P, InsertPos);
312 return P->getValue();
315 const std::pair<SVal, SVal>&
321 llvm::FoldingSetNodeID
ID;
328 typedef llvm::FoldingSetNodeWrapper<SValPair> FoldNodeTy;
329 FoldNodeTy*
P = Map.FindNodeOrInsertPos(ID, InsertPos);
332 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
333 new (
P) FoldNodeTy(std::make_pair(V1, V2));
334 Map.InsertNode(P, InsertPos);
337 return P->getValue();
Defines the clang::ASTContext interface.
void Profile(llvm::FoldingSetNodeID &ID) const
TypedValueRegion - An abstract class representing regions having a typed value.
A (possibly-)qualified type.
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, QualType T)
llvm::ImmutableList< const CXXBaseSpecifier * > getCXXBaseList() const
static void Profile(llvm::FoldingSetNodeID &ID, const DeclaratorDecl *D, llvm::ImmutableList< const CXXBaseSpecifier * > L)
const clang::ento::PointerToMemberData * accumCXXBase(llvm::iterator_range< CastExpr::path_const_iterator > PathRange, const nonloc::PointerToMember &PTM)
Value representing pointer-to-member.
llvm::ImmutableList< const CXXBaseSpecifier * > prependCXXBase(const CXXBaseSpecifier *CBS, llvm::ImmutableList< const CXXBaseSpecifier * > L)
const SVal * getPersistentSVal(SVal X)
detail::InMemoryDirectory::const_iterator I
std::pair< SVal, SVal > SValPair
Represents a ValueDecl that came out of a declarator.
llvm::PointerUnion< const DeclaratorDecl *, const PointerToMemberData * > PTMDataType
unsigned Map[FirstTargetAddressSpace]
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static void Profile(llvm::FoldingSetNodeID &ID, const StoreRef &store, const TypedValueRegion *region)
llvm::FoldingSet< llvm::FoldingSetNodeWrapper< SValPair > > PersistentSValPairsTy
SVal - This represents a symbolic expression, which can be either an L-value or an R-value...
const llvm::APSInt * evalAPSInt(BinaryOperator::Opcode Op, const llvm::APSInt &V1, const llvm::APSInt &V2)
std::pair< SVal, uintptr_t > SValData
const PointerToMemberData * getPointerToMemberData(const DeclaratorDecl *DD, llvm::ImmutableList< const CXXBaseSpecifier * > L)
const PTMDataType getPTMData() const
llvm::FoldingSet< llvm::FoldingSetNodeWrapper< SValData > > PersistentSValsTy
static void Profile(llvm::FoldingSetNodeID &ID, QualType T, llvm::ImmutableList< SVal > L)
const DeclaratorDecl * getDeclaratorDecl() const
detail::InMemoryDirectory::const_iterator E
static void Profile(const SValPair &X, llvm::FoldingSetNodeID &ID)
const std::pair< SVal, uintptr_t > & getPersistentSValWithData(const SVal &V, uintptr_t Data)
X
Add a minimal nested name specifier fixit hint to allow lookup of a tag name from an outer enclosing ...
const LazyCompoundValData * getLazyCompoundValData(const StoreRef &store, const TypedValueRegion *region)
static void Profile(const SValData &X, llvm::FoldingSetNodeID &ID)
void Profile(llvm::FoldingSetNodeID &ID) const
APSIntType getAPSIntType(QualType T) const
Returns the type of the APSInt used to store values of the given QualType.