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 | 27b867ea1c9cb4b40f9b817c303d6df3ee753da9 (patch) | |
tree | f84fdebe57f3e26805c7f4723c29ed3287bc4115 /include/clang | |
parent | 046c9e6d18b1ee8c77755336bf350cc4ca8545ca (diff) |
[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 'include/clang')
-rw-r--r-- | include/clang/StaticAnalyzer/Core/PathSensitive/Store.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h b/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h index 1c99f40eaf..d0edba175b 100644 --- a/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h +++ b/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h @@ -205,6 +205,21 @@ public: const MemRegion *region, SVal val) = 0; }; + class FindUniqueBinding : + public BindingsHandler { + SymbolRef Sym; + const MemRegion* Binding; + bool First; + + public: + FindUniqueBinding(SymbolRef sym) : Sym(sym), Binding(0), First(true) {} + + bool HandleBinding(StoreManager& SMgr, Store store, const MemRegion* R, + SVal val); + operator bool() { return First && Binding; } + const MemRegion *getRegion() { return Binding; } + }; + /// iterBindings - Iterate over the bindings in the Store. virtual void iterBindings(Store store, BindingsHandler& f) = 0; |