]> granicus.if.org Git - clang/commitdiff
Implement RegionStoreManager::iterBindings(). This implementation only returns the...
authorTed Kremenek <kremenek@apple.com>
Thu, 17 Jun 2010 00:24:42 +0000 (00:24 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 17 Jun 2010 00:24:42 +0000 (00:24 +0000)
the binding key instead of the region + offset.  It isn't clear if this is the best semantics, but most
clients will likely only care about simple bindings, or bindings to a particular variable.  We can
refine later if necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106183 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp

index d9ad02a35c4d9683531ce3763c0e801981fbadc0..6f8c2504bd56db6808bb34c863d16c622c492a2d 100644 (file)
@@ -399,12 +399,17 @@ public: // Part of public interface to class.
              const char *sep);
 
   void iterBindings(Store store, BindingsHandler& f) {
-    // FIXME: Implement.
-  }
-
-  // FIXME: Remove.
-  BasicValueFactory& getBasicVals() {
-      return StateMgr.getBasicVals();
+    RegionBindings B = GetRegionBindings(store);
+    for (RegionBindings::iterator I=B.begin(), E=B.end(); I!=E; ++I) {
+      const BindingKey &K = I.getKey();
+      if (!K.isDirect())
+        continue;
+      if (const SubRegion *R = dyn_cast<SubRegion>(I.getKey().getRegion())) {
+        // FIXME: Possibly incorporate the offset?
+        if (!f.HandleBinding(*this, store, R, I.getData()))
+          return;
+      }
+    }
   }
 
   // FIXME: Remove.