BasicStore:
- Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal
binding. This mirrors some of the idea of RegionStore, but is far simpler and
not nearly as functional. This leads to some code simplification and
some potential for some minor precision hacks.
Along the way...
- constify the use of MemRegion* in a few places
- add operator<<(llvm::raw_ostream, const MemRegion*)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66163 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 6929af3..8c3d9bf 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -2663,13 +2663,14 @@
class VISIBILITY_HIDDEN FindUniqueBinding :
public StoreManager::BindingsHandler {
SymbolRef Sym;
- MemRegion* Binding;
+ const MemRegion* Binding;
bool First;
public:
FindUniqueBinding(SymbolRef sym) : Sym(sym), Binding(0), First(true) {}
- bool HandleBinding(StoreManager& SMgr, Store store, MemRegion* R, SVal val) {
+ bool HandleBinding(StoreManager& SMgr, Store store, const MemRegion* R,
+ SVal val) {
SymbolRef SymV = val.getAsSymbol();
if (!SymV.isValid() || SymV != Sym)
@@ -2686,7 +2687,7 @@
}
operator bool() { return First && Binding; }
- MemRegion* getRegion() { return Binding; }
+ const MemRegion* getRegion() { return Binding; }
};
}