20 using namespace clang;
26 ID.AddPointer(L.getInternalPointer());
33 ID.AddPointer(region);
43 ID.AddPointer( (
void*) X.second);
55 typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<SValData> >
58 typedef llvm::FoldingSet<llvm::FoldingSetNodeWrapper<SValPair> >
66 I->getValue().~APSInt();
72 const llvm::APSInt& BasicValueFactory::getValue(
const llvm::APSInt&
X) {
73 llvm::FoldingSetNodeID
ID;
75 typedef llvm::FoldingSetNodeWrapper<llvm::APSInt> FoldNodeTy;
78 FoldNodeTy*
P = APSIntSet.FindNodeOrInsertPos(ID, InsertPos);
81 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
82 new (
P) FoldNodeTy(X);
83 APSIntSet.InsertNode(P, InsertPos);
89 const llvm::APSInt& BasicValueFactory::getValue(
const llvm::APInt&
X,
91 llvm::APSInt V(X, isUnsigned);
95 const llvm::APSInt& BasicValueFactory::getValue(uint64_t
X,
unsigned BitWidth,
97 llvm::APSInt V(BitWidth, isUnsigned);
102 const llvm::APSInt& BasicValueFactory::getValue(uint64_t
X,
QualType T) {
111 llvm::FoldingSetNodeID
ID;
115 CompoundValData* D = CompoundValDataSet.FindNodeOrInsertPos(ID, InsertPos);
120 CompoundValDataSet.InsertNode(D, InsertPos);
129 llvm::FoldingSetNodeID
ID;
134 LazyCompoundValDataSet.FindNodeOrInsertPos(ID, InsertPos);
139 LazyCompoundValDataSet.InsertNode(D, InsertPos);
147 const llvm::APSInt& V1,
const llvm::APSInt& V2) {
151 assert (
false &&
"Invalid Opcode.");
154 return &getValue( V1 * V2 );
159 return &getValue( V1 / V2 );
164 return &getValue( V1 % V2 );
167 return &getValue( V1 + V2 );
170 return &getValue( V1 - V2 );
179 if (V2.isSigned() && V2.isNegative())
182 uint64_t Amt = V2.getZExtValue();
184 if (Amt >= V1.getBitWidth())
187 return &getValue( V1.operator<<( (
unsigned) Amt ));
197 if (V2.isSigned() && V2.isNegative())
200 uint64_t Amt = V2.getZExtValue();
202 if (Amt >= V1.getBitWidth())
205 return &getValue( V1.operator>>( (
unsigned) Amt ));
229 return &getValue( V1 & V2 );
232 return &getValue( V1 | V2 );
235 return &getValue( V1 ^ V2 );
240 const std::pair<SVal, uintptr_t>&
246 llvm::FoldingSetNodeID
ID;
249 ID.AddPointer((
void*) Data);
253 typedef llvm::FoldingSetNodeWrapper<SValData> FoldNodeTy;
254 FoldNodeTy*
P = Map.FindNodeOrInsertPos(ID, InsertPos);
257 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
258 new (
P) FoldNodeTy(std::make_pair(V, Data));
259 Map.InsertNode(P, InsertPos);
262 return P->getValue();
265 const std::pair<SVal, SVal>&
271 llvm::FoldingSetNodeID
ID;
278 typedef llvm::FoldingSetNodeWrapper<SValPair> FoldNodeTy;
279 FoldNodeTy*
P = Map.FindNodeOrInsertPos(ID, InsertPos);
282 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
283 new (
P) FoldNodeTy(std::make_pair(V1, V2));
284 Map.InsertNode(P, InsertPos);
287 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)
const SVal * getPersistentSVal(SVal X)
detail::InMemoryDirectory::const_iterator I
std::pair< SVal, SVal > SValPair
__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)
const TemplateArgument * iterator
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
llvm::FoldingSet< llvm::FoldingSetNodeWrapper< SValData > > PersistentSValsTy
static void Profile(llvm::FoldingSetNodeID &ID, QualType T, llvm::ImmutableList< SVal > L)
detail::InMemoryDirectory::const_iterator E
unsigned Map[Count]
The type of a lookup table which maps from language-specific address spaces to target-specific ones...
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.