summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/Store.cpp
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-03-21 19:45:01 +0000
committerAnna Zaks <ganna@apple.com>2012-03-21 19:45:01 +0000
commit27b867ea1c9cb4b40f9b817c303d6df3ee753da9 (patch)
treef84fdebe57f3e26805c7f4723c29ed3287bc4115 /lib/StaticAnalyzer/Core/Store.cpp
parent046c9e6d18b1ee8c77755336bf350cc4ca8545ca (diff)
downloadclang-27b867ea1c9cb4b40f9b817c303d6df3ee753da9.tar.gz
[analyser] Factor out FindUniqueBinding from RetainCount checker.
So that others could use it as well. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153211 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/Store.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/Store.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/StaticAnalyzer/Core/Store.cpp b/lib/StaticAnalyzer/Core/Store.cpp
index acf5e193ab..11748ae54d 100644
--- a/lib/StaticAnalyzer/Core/Store.cpp
+++ b/lib/StaticAnalyzer/Core/Store.cpp
@@ -340,5 +340,23 @@ SVal StoreManager::getLValueElement(QualType elementType, NonLoc Offset,
StoreManager::BindingsHandler::~BindingsHandler() {}
+bool StoreManager::FindUniqueBinding::HandleBinding(StoreManager& SMgr,
+ Store store,
+ const MemRegion* R,
+ SVal val) {
+ SymbolRef SymV = val.getAsLocSymbol();
+ if (!SymV || SymV != Sym)
+ return true;
+
+ if (Binding) {
+ First = false;
+ return false;
+ }
+ else
+ Binding = R;
+
+ return true;
+}
+
void SubRegionMap::anchor() { }
void SubRegionMap::Visitor::anchor() { }