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))
191 PathList = prependCXXBase(I, PathList);
192 return getPointerToMemberData(DD, PathList);
197 const llvm::APSInt& V1,
const llvm::APSInt& V2) {
201 assert (
false &&
"Invalid Opcode.");
228 if (V1.isSigned() && V1.isNegative())
231 if (V2.isSigned() && V2.isNegative())
234 uint64_t Amt = V2.getZExtValue();
236 if (Amt >= V1.getBitWidth())
239 return &
getValue( V1.operator<<( (
unsigned) Amt ));
249 if (V2.isSigned() && V2.isNegative())
252 uint64_t Amt = V2.getZExtValue();
254 if (Amt >= V1.getBitWidth())
257 return &
getValue( V1.operator>>( (
unsigned) Amt ));
261 return &getTruthValue( V1 < V2 );
264 return &getTruthValue( V1 > V2 );
267 return &getTruthValue( V1 <= V2 );
270 return &getTruthValue( V1 >= V2 );
273 return &getTruthValue( V1 == V2 );
276 return &getTruthValue( V1 != V2 );
292 const std::pair<SVal, uintptr_t>&
298 llvm::FoldingSetNodeID
ID;
301 ID.AddPointer((
void*) Data);
305 typedef llvm::FoldingSetNodeWrapper<SValData> FoldNodeTy;
306 FoldNodeTy*
P = Map.FindNodeOrInsertPos(ID, InsertPos);
309 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
310 new (
P) FoldNodeTy(std::make_pair(V, Data));
311 Map.InsertNode(P, InsertPos);
314 return P->getValue();
317 const std::pair<SVal, SVal>&
323 llvm::FoldingSetNodeID
ID;
330 typedef llvm::FoldingSetNodeWrapper<SValPair> FoldNodeTy;
331 FoldNodeTy*
P = Map.FindNodeOrInsertPos(ID, InsertPos);
334 P = (FoldNodeTy*) BPAlloc.Allocate<FoldNodeTy>();
335 new (
P) FoldNodeTy(std::make_pair(V1, V2));
336 Map.InsertNode(P, InsertPos);
339 return P->getValue();
343 return &getPersistentSValWithData(X, 0).first;
Defines the clang::ASTContext interface.
TypedValueRegion - An abstract class representing regions having a typed value.
A (possibly-)qualified type.
llvm::ImmutableList< const CXXBaseSpecifier * > getCXXBaseList() const
DominatorTree GraphTraits specialization so the DominatorTree can be iterable by generic graph iterat...
const CompoundValData * getCompoundValData(QualType T, llvm::ImmutableList< SVal > Vals)
const std::pair< SVal, SVal > & getPersistentSValPair(const SVal &V1, const SVal &V2)
const clang::ento::PointerToMemberData * accumCXXBase(llvm::iterator_range< CastExpr::path_const_iterator > PathRange, const nonloc::PointerToMember &PTM)
const PTMDataType getPTMData() const
const DeclaratorDecl * getDeclaratorDecl() const
Value representing pointer-to-member.
const SVal * getPersistentSVal(SVal X)
std::pair< SVal, SVal > SValPair
Represents a ValueDecl that came out of a declarator.
const PointerToMemberData * getPointerToMemberData(const DeclaratorDecl *DD, llvm::ImmutableList< const CXXBaseSpecifier *> L)
const FunctionProtoType * T
llvm::PointerUnion< const DeclaratorDecl *, const PointerToMemberData * > PTMDataType
void Profile(llvm::FoldingSetNodeID &ID) const
static SVal getValue(SVal val, SValBuilder &svalBuilder)
__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)
void Profile(llvm::FoldingSetNodeID &ID) const
llvm::FoldingSet< llvm::FoldingSetNodeWrapper< SValPair > > PersistentSValPairsTy
static void Profile(llvm::FoldingSetNodeID &ID, const DeclaratorDecl *D, llvm::ImmutableList< const CXXBaseSpecifier *> L)
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
Dataflow Directional Tag Classes.
llvm::FoldingSet< llvm::FoldingSetNodeWrapper< SValData > > PersistentSValsTy
static void Profile(llvm::FoldingSetNodeID &ID, QualType T, llvm::ImmutableList< SVal > L)
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)
CompoundValData(QualType t, llvm::ImmutableList< SVal > l)