[cfe-commits] r60505 - /cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h

Ted Kremenek kremenek at apple.com
Wed Dec 3 12:49:14 PST 2008


Author: kremenek
Date: Wed Dec  3 14:49:14 2008
New Revision: 60505

URL: http://llvm.org/viewvc/llvm-project?rev=60505&view=rev
Log:
Added GDM query functions "contains" for the data types that support the "Contains" method.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h?rev=60505&r1=60504&r2=60505&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRState.h Wed Dec  3 14:49:14 2008
@@ -162,6 +162,12 @@
     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 @@
   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 @@
     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);





More information about the cfe-commits mailing list