diff --git a/clang/include/clang/Analysis/PathSensitive/GRState.h b/clang/include/clang/Analysis/PathSensitive/GRState.h index b1e866c67c88..0e72742e631f 100644 --- a/clang/include/clang/Analysis/PathSensitive/GRState.h +++ b/clang/include/clang/Analysis/PathSensitive/GRState.h @@ -162,6 +162,12 @@ public: return GRStateTrait::Lookup(GRStateTrait::MakeData(d), key); } + template + bool contains(typename GRStateTrait::key_type key) const { + void* const* d = FindGDM(GRStateTrait::GDMIndex()); + return GRStateTrait::Contains(GRStateTrait::MakeData(d), key); + } + // State pretty-printing. class Printer { public: @@ -623,7 +629,7 @@ public: template typename GRStateTrait::context_type get_context() { return Mgr->get_context(); - } + } template GRStateRef set(typename GRStateTrait::key_type K, @@ -649,6 +655,11 @@ public: return GRStateRef(Mgr->remove(St, K, get_context()), *Mgr); } + template + bool contains(typename GRStateTrait::key_type key) const { + return St->contains(key); + } + // Lvalue methods. SVal GetLValue(const VarDecl* VD) { return Mgr->GetLValue(St, VD);