/// getDefaultBinding - Returns an SVal* representing an optional default
/// binding associated with a region and its subregions.
Optional<SVal> getDefaultBinding(const MemRegion *R);
+
+ /// Return the internal tree as a Store.
+ Store asStore() const {
+ return asImmutableMap().getRootWithoutRetain();
+ }
};
} // end anonymous namespace
// invalidate that region. This is because a block may capture
// a pointer value, but the thing pointed by that pointer may
// get invalidated.
- Store store = B.asImmutableMap().getRootWithoutRetain();
+ Store store = B.asStore();
SVal V = RM.getBinding(store, loc::MemRegionVal(VR));
if (const Loc *L = dyn_cast<Loc>(&V)) {
if (const MemRegion *LR = L->getAsRegion())
Ex, Count, LCtx, B, Invalidated);
}
- return StoreRef(B.asImmutableMap().getRootWithoutRetain(), *this);
+ return StoreRef(B.asStore(), *this);
}
//===----------------------------------------------------------------------===//
RegionBindingsRef B = getRegionBindings(store);
B = removeSubRegionBindings(B, cast<SubRegion>(R));
BindingKey Key = BindingKey::Make(R, BindingKey::Direct);
- return StoreRef(B.addBinding(Key, V).asImmutableMap().getRootWithoutRetain(),
+ return StoreRef(B.addBinding(Key, V).asStore(),
*this);
}
}
return StoreRef(B.addBinding(R, BindingKey::Default, V)
- .asImmutableMap().getRootWithoutRetain(), *this);
+ .asStore(), *this);
}
StoreRef RegionStoreManager::BindArray(Store store, const TypedValueRegion* R,
if (FI != FE) {
RegionBindingsRef B = getRegionBindings(newStore.getStore());
B = B.addBinding(R, BindingKey::Default, svalBuilder.makeIntVal(0, false));
- newStore = StoreRef(B.asImmutableMap().getRootWithoutRetain(), *this);
+ newStore = StoreRef(B.asStore(), *this);
}
return newStore;
// we will invalidate. Then add the new binding.
RegionBindingsRef B = getRegionBindings(store);
B = removeSubRegionBindings(B, R).addBinding(R, BindingKey::Default, Val);
- return StoreRef(B.asImmutableMap().getRootWithoutRetain(), *this);
+ return StoreRef(B.asStore(), *this);
}
//===----------------------------------------------------------------------===//
}
}
- return StoreRef(B.asImmutableMap().getRootWithoutRetain(), *this);
+ return StoreRef(B.asStore(), *this);
}
//===----------------------------------------------------------------------===//
const char* nl, const char *sep) {
RegionBindingsRef B = getRegionBindings(store);
OS << "Store (direct and default bindings), "
- << (void*) B.asImmutableMap().getRootWithoutRetain()
+ << B.asStore()
<< " :" << nl;
for (RegionBindingsRef::iterator I = B.begin(), E = B.end(); I != E; ++I) {