diff options
author | Anna Zaks <ganna@apple.com> | 2012-03-21 19:45:01 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-03-21 19:45:01 +0000 |
commit | 6797d6ee237ab6903fc526c66e69a8a159556860 (patch) | |
tree | 39132b4068c604e0dc83124226da75d7b248ad62 /clang/lib/StaticAnalyzer/Core | |
parent | d42e8287209fe026b9a1011f82301f8ab71e77df (diff) | |
download | bcm5719-llvm-6797d6ee237ab6903fc526c66e69a8a159556860.tar.gz bcm5719-llvm-6797d6ee237ab6903fc526c66e69a8a159556860.zip |
[analyser] Factor out FindUniqueBinding from RetainCount checker.
So that others could use it as well. No functionality change.
llvm-svn: 153211
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core')
-rw-r--r-- | clang/lib/StaticAnalyzer/Core/Store.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/Store.cpp b/clang/lib/StaticAnalyzer/Core/Store.cpp index acf5e193ab3..11748ae54db 100644 --- a/clang/lib/StaticAnalyzer/Core/Store.cpp +++ b/clang/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() { } |