aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-03 20:49:14 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-03 20:49:14 +0000
commit39b630fc1cef83d58c6e0f551debb16a4d547abe (patch)
tree66f1727e617269a587d8f1f8b5af47ad9c33c6d9
parent32d600ce59e780b7ff969309cbf742159abe018b (diff)
Added GDM query functions "contains" for the data types that support the "Contains" method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60505 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/GRState.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRState.h b/include/clang/Analysis/PathSensitive/GRState.h
index b1e866c67c..0e72742e63 100644
--- a/include/clang/Analysis/PathSensitive/GRState.h
+++ b/include/clang/Analysis/PathSensitive/GRState.h
@@ -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);