From: Jordy Rose Date: Mon, 16 Aug 2010 20:53:01 +0000 (+0000) Subject: Instead of using operator bool() for testing if a BindingKey is valid, use an explici... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d5addb48398241e1f63c114d860dfe30346258e8;p=clang Instead of using operator bool() for testing if a BindingKey is valid, use an explicit isValid() method. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111181 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Checker/RegionStore.cpp b/lib/Checker/RegionStore.cpp index 1c74c3f3a3..7dd503c0f5 100644 --- a/lib/Checker/RegionStore.cpp +++ b/lib/Checker/RegionStore.cpp @@ -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); }