]> granicus.if.org Git - clang/commitdiff
Instead of using operator bool() for testing if a BindingKey is valid, use an explici...
authorJordy Rose <jediknil@belkadan.com>
Mon, 16 Aug 2010 20:53:01 +0000 (20:53 +0000)
committerJordy Rose <jediknil@belkadan.com>
Mon, 16 Aug 2010 20:53:01 +0000 (20:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111181 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Checker/RegionStore.cpp

index 1c74c3f3a311a93b6428a3d5276c0c7b06c346bd..7dd503c0f5694ecd5a7c99e0e2761330e00c4cc6 100644 (file)
@@ -73,7 +73,7 @@ public:
            Offset == X.Offset;
   }
 
-  operator bool() const {
+  bool isValid() const {
     return getRegion() != NULL;
   }
 };
@@ -1618,7 +1618,7 @@ BindingKey BindingKey::Make(const MemRegion *R, Kind k) {
 }
 
 RegionBindings RegionStoreManager::Add(RegionBindings B, BindingKey K, SVal V) {
-  if (!K)
+  if (!K.isValid())
     return B;
   return RBFactory.Add(B, K, V);
 }
@@ -1629,7 +1629,7 @@ RegionBindings RegionStoreManager::Add(RegionBindings B, const MemRegion *R,
 }
 
 const SVal *RegionStoreManager::Lookup(RegionBindings B, BindingKey K) {
-  if (!K)
+  if (!K.isValid())
     return NULL;
   return B.lookup(K);
 }
@@ -1641,7 +1641,7 @@ const SVal *RegionStoreManager::Lookup(RegionBindings B,
 }
 
 RegionBindings RegionStoreManager::Remove(RegionBindings B, BindingKey K) {
-  if (!K)
+  if (!K.isValid())
     return B;
   return RBFactory.Remove(B, K);
 }