Added GDM query functions "contains" for the data types that support the "Contains" method.

llvm-svn: 60505
This commit is contained in:
Ted Kremenek 2008-12-03 20:49:14 +00:00
parent 217dc8de69
commit 5a6ef49e70
1 changed files with 12 additions and 1 deletions

View File

@ -162,6 +162,12 @@ public:
return GRStateTrait<T>::Lookup(GRStateTrait<T>::MakeData(d), key);
}
template<typename T>
bool contains(typename GRStateTrait<T>::key_type key) const {
void* const* d = FindGDM(GRStateTrait<T>::GDMIndex());
return GRStateTrait<T>::Contains(GRStateTrait<T>::MakeData(d), key);
}
// State pretty-printing.
class Printer {
public:
@ -623,7 +629,7 @@ public:
template <typename T>
typename GRStateTrait<T>::context_type get_context() {
return Mgr->get_context<T>();
}
}
template<typename T>
GRStateRef set(typename GRStateTrait<T>::key_type K,
@ -649,6 +655,11 @@ public:
return GRStateRef(Mgr->remove<T>(St, K, get_context<T>()), *Mgr);
}
template<typename T>
bool contains(typename GRStateTrait<T>::key_type key) const {
return St->contains(key);
}
// Lvalue methods.
SVal GetLValue(const VarDecl* VD) {
return Mgr->GetLValue(St, VD);