void FlushReport(BugReportEquivClass& EQ);
protected:
- BugReporter(BugReporterData& d, Kind k) : BugTypes(F.GetEmptySet()), kind(k),
+ BugReporter(BugReporterData& d, Kind k) : BugTypes(F.getEmptySet()), kind(k),
D(d) {}
public:
- BugReporter(BugReporterData& d) : BugTypes(F.GetEmptySet()), kind(BaseBRKind),
+ BugReporter(BugReporterData& d) : BugTypes(F.getEmptySet()), kind(BaseBRKind),
D(d) {}
virtual ~BugReporter();
llvm::ImmutableList<BugReporterVisitor*> Callbacks;
llvm::FoldingSet<BugReporterVisitor> CallbacksSet;
public:
- BugReporterContext(GRBugReporter& br) : BR(br), Callbacks(F.GetEmptyList()) {}
+ BugReporterContext(GRBugReporter& br) : BR(br), Callbacks(F.getEmptyList()) {}
virtual ~BugReporterContext();
void addVisitor(BugReporterVisitor* visitor);
const TypedRegion *region);
llvm::ImmutableList<SVal> getEmptySValList() {
- return SValListFactory.GetEmptyList();
+ return SValListFactory.getEmptyList();
}
llvm::ImmutableList<SVal> consVals(SVal X, llvm::ImmutableList<SVal> L) {
- return SValListFactory.Add(X, L);
+ return SValListFactory.add(X, L);
}
const llvm::APSInt* EvaluateAPSInt(BinaryOperator::Opcode Op,
~EnvironmentManager() {}
Environment getInitialEnvironment() {
- return Environment(F.GetEmptyMap());
+ return Environment(F.getEmptyMap());
}
/// Bind the value 'V' to the statement 'S'.
return B.lookup(K);
}
static data_type Set(data_type B, key_type K, value_type E,context_type F){
- return F.Add(B, K, E);
+ return F.add(B, K, E);
}
static data_type Remove(data_type B, key_type K, context_type F) {
- return F.Remove(B, K);
+ return F.remove(B, K);
}
static inline context_type MakeContext(void* p) {
}
static data_type Add(data_type B, key_type K, context_type F) {
- return F.Add(B, K);
+ return F.add(B, K);
}
static data_type Remove(data_type B, key_type K, context_type F) {
- return F.Remove(B, K);
+ return F.remove(B, K);
}
static bool Contains(data_type B, key_type K) {
typedef typename data_type::Factory& context_type;
static data_type Add(data_type L, key_type K, context_type F) {
- return F.Add(K, L);
+ return F.add(K, L);
}
static inline data_type MakeData(void* const* p) {
// First, retrieve the NE-set associated with the given symbol.
ConstNotEqTy::data_type* T = state->get<ConstNotEq>(sym);
- GRState::IntSetTy S = T ? *T : ISetFactory.GetEmptySet();
+ GRState::IntSetTy S = T ? *T : ISetFactory.getEmptySet();
// Now add V to the NE set.
- S = ISetFactory.Add(S, &state->getBasicVals().getValue(V));
+ S = ISetFactory.add(S, &state->getBasicVals().getValue(V));
// Create a new state with the old binding replaced.
return state->set<ConstNotEq>(sym, S);
for (ConstEqTy::iterator I = CE.begin(), E = CE.end(); I!=E; ++I) {
SymbolRef sym = I.getKey();
- if (SymReaper.maybeDead(sym)) CE = CEFactory.Remove(CE, sym);
+ if (SymReaper.maybeDead(sym))
+ CE = CEFactory.remove(CE, sym);
}
state = state->set<ConstEq>(CE);
for (ConstNotEqTy::iterator I = CNE.begin(), E = CNE.end(); I != E; ++I) {
SymbolRef sym = I.getKey();
- if (SymReaper.maybeDead(sym)) CNE = CNEFactory.Remove(CNE, sym);
+ if (SymReaper.maybeDead(sym))
+ CNE = CNEFactory.remove(CNE, sym);
}
return state->set<ConstNotEq>(CNE);
// that is used to derive other symbols.
if (isa<NonStaticGlobalSpaceRegion>(R)) {
BindingsTy B = GetBindings(store);
- return VBFactory.Add(B, R, V).getRoot();
+ return VBFactory.add(B, R, V).getRoot();
}
// Special case: handle store of pointer values (Loc) to pointers via
BindingsTy B = GetBindings(store);
return V.isUnknown()
- ? VBFactory.Remove(B, R).getRoot()
- : VBFactory.Add(B, R, V).getRoot();
+ ? VBFactory.remove(B, R).getRoot()
+ : VBFactory.add(B, R, V).getRoot();
}
Store BasicStoreManager::Remove(Store store, Loc loc) {
isa<CXXThisRegion>(R)))
return store;
- return VBFactory.Remove(GetBindings(store), R).getRoot();
+ return VBFactory.remove(GetBindings(store), R).getRoot();
}
default:
assert ("Remove for given Loc type not yet implemented.");
// any VarDecl whose value originally comes from outside the function.
typedef LiveVariables::AnalysisDataTy LVDataTy;
LVDataTy& D = InitLoc->getLiveVariables()->getAnalysisData();
- Store St = VBFactory.GetEmptyMap().getRoot();
+ Store St = VBFactory.getEmptyMap().getRoot();
for (LVDataTy::decl_iterator I=D.begin_decl(), E=D.end_decl(); I != E; ++I) {
const NamedDecl* ND = I->first;
}
CallbacksSet.InsertNode(visitor, InsertPos);
- Callbacks = F.Add(visitor, Callbacks);
+ Callbacks = F.add(visitor, Callbacks);
}
//===----------------------------------------------------------------------===//
}
// Remove all references to the BugType objects.
- BugTypes = F.GetEmptySet();
+ BugTypes = F.getEmptySet();
}
//===----------------------------------------------------------------------===//
}
void BugReporter::Register(BugType *BT) {
- BugTypes = F.Add(BugTypes, BT);
+ BugTypes = F.add(BugTypes, BT);
}
void BugReporter::EmitReport(BugReport* R) {
}
void addPanicSummary(const char* Cls, ...) {
- RetainSummary* Summ = getPersistentSummary(AF.GetEmptyMap(),
+ RetainSummary* Summ = getPersistentSummary(AF.getEmptyMap(),
RetEffect::MakeNoRet(),
DoNothing, DoNothing, true);
va_list argp;
RetainSummaryManager(ASTContext& ctx, bool gcenabled)
: Ctx(ctx),
CFDictionaryCreateII(&ctx.Idents.get("CFDictionaryCreate")),
- GCEnabled(gcenabled), AF(BPAlloc), ScratchArgs(AF.GetEmptyMap()),
+ GCEnabled(gcenabled), AF(BPAlloc), ScratchArgs(AF.getEmptyMap()),
ObjCAllocRetE(gcenabled ? RetEffect::MakeGCNotOwned()
: RetEffect::MakeOwned(RetEffect::ObjC, true)),
ObjCInitRetE(gcenabled ? RetEffect::MakeGCNotOwned()
: RetEffect::MakeOwnedWhenTrackedReceiver()),
- DefaultSummary(AF.GetEmptyMap() /* per-argument effects (none) */,
+ DefaultSummary(AF.getEmptyMap() /* per-argument effects (none) */,
RetEffect::MakeNoRet() /* return effect */,
MayEscape, /* default argument effect */
DoNothing /* receiver effect */),
ArgEffects RetainSummaryManager::getArgEffects() {
ArgEffects AE = ScratchArgs;
- ScratchArgs = AF.GetEmptyMap();
+ ScratchArgs = AF.getEmptyMap();
return AE;
}
// FIXES: <rdar://problem/6326900>
// This should be addressed using a API table. This strcmp is also
// a little gross, but there is no need to super optimize here.
- ScratchArgs = AF.Add(ScratchArgs, 1, DecRef);
+ ScratchArgs = AF.add(ScratchArgs, 1, DecRef);
S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, DoNothing);
} else if (FName == "IOServiceAddNotification" ||
FName == "IOServiceAddMatchingNotification") {
// Part of <rdar://problem/6961230>. (IOKit)
// This should be addressed using a API table.
- ScratchArgs = AF.Add(ScratchArgs, 2, DecRef);
+ ScratchArgs = AF.add(ScratchArgs, 2, DecRef);
S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, DoNothing);
} else if (FName == "CVPixelBufferCreateWithBytes") {
// FIXES: <rdar://problem/7283567>
// a callback and doing full IPA to make sure this is done correctly.
// FIXME: This function has an out parameter that returns an
// allocated object.
- ScratchArgs = AF.Add(ScratchArgs, 7, StopTracking);
+ ScratchArgs = AF.add(ScratchArgs, 7, StopTracking);
S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, DoNothing);
} else if (FName == "CGBitmapContextCreateWithData") {
// FIXES: <rdar://problem/7358899>
// Eventually this can be improved by recognizing that 'releaseInfo'
// passed to CGBitmapContextCreateWithData is released via
// a callback and doing full IPA to make sure this is done correctly.
- ScratchArgs = AF.Add(ScratchArgs, 8, StopTracking);
+ ScratchArgs = AF.add(ScratchArgs, 8, StopTracking);
S = getPersistentSummary(RetEffect::MakeOwned(RetEffect::CF, true),
DoNothing, DoNothing);
} else if (FName == "CVPixelBufferCreateWithPlanarBytes") {
// buffer passed to CVPixelBufferCreateWithPlanarBytes is released
// via a callback and doing full IPA to make sure this is done
// correctly.
- ScratchArgs = AF.Add(ScratchArgs, 12, StopTracking);
+ ScratchArgs = AF.add(ScratchArgs, 12, StopTracking);
S = getPersistentSummary(RetEffect::MakeNoRet(), DoNothing, DoNothing);
}
switch (func) {
case cfretain: {
- ScratchArgs = AF.Add(ScratchArgs, 0, IncRef);
+ ScratchArgs = AF.add(ScratchArgs, 0, IncRef);
return getPersistentSummary(RetEffect::MakeAlias(0),
DoNothing, DoNothing);
}
case cfrelease: {
- ScratchArgs = AF.Add(ScratchArgs, 0, DecRef);
+ ScratchArgs = AF.add(ScratchArgs, 0, DecRef);
return getPersistentSummary(RetEffect::MakeNoRet(),
DoNothing, DoNothing);
}
case cfmakecollectable: {
- ScratchArgs = AF.Add(ScratchArgs, 0, MakeCollectable);
+ ScratchArgs = AF.add(ScratchArgs, 0, MakeCollectable);
return getPersistentSummary(RetEffect::MakeAlias(0),DoNothing, DoNothing);
}
assert (ScratchArgs.isEmpty());
if (FD->getIdentifier() == CFDictionaryCreateII) {
- ScratchArgs = AF.Add(ScratchArgs, 1, DoNothingByRef);
- ScratchArgs = AF.Add(ScratchArgs, 2, DoNothingByRef);
+ ScratchArgs = AF.add(ScratchArgs, 1, DoNothingByRef);
+ ScratchArgs = AF.add(ScratchArgs, 2, DoNothingByRef);
}
return getPersistentSummary(RetEffect::MakeOwned(RetEffect::CF, true));
if (ParmVarDecl *PD = *I) {
QualType Ty = Ctx.getCanonicalType(PD->getType());
if (Ty.getLocalUnqualifiedType() == Ctx.VoidPtrTy)
- ScratchArgs = AF.Add(ScratchArgs, i, StopTracking);
+ ScratchArgs = AF.add(ScratchArgs, i, StopTracking);
}
}
getPersistentSummary(RetEffect::MakeNotOwned(RetEffect::ObjC)));
// Create the [NSAutoreleasePool addObject:] summary.
- ScratchArgs = AF.Add(ScratchArgs, 0, Autorelease);
+ ScratchArgs = AF.add(ScratchArgs, 0, Autorelease);
addClassMethSummary("NSAutoreleasePool", "addObject",
getPersistentSummary(RetEffect::MakeNoRet(),
DoNothing, Autorelease));
if (cnts) {
const unsigned *cnt = (*cnts).lookup(sym);
- newCnts = F.Add(*cnts, sym, cnt ? *cnt + 1 : 1);
+ newCnts = F.add(*cnts, sym, cnt ? *cnt + 1 : 1);
}
else
- newCnts = F.Add(F.GetEmptyMap(), sym, 1);
+ newCnts = F.add(F.getEmptyMap(), sym, 1);
return state->set<AutoreleasePoolContents>(pool, newCnts);
}
// If this is the case, stop tracking the symbol.
if (state->getSymVal(I.getKey())) {
changed = true;
- B = RefBFactory.Remove(B, I.getKey());
+ B = RefBFactory.remove(B, I.getKey());
}
}
RefBindings::Factory& F = state->get_context<RefBindings>();
for (SymbolReaper::dead_iterator I = SymReaper.dead_begin(),
- E = SymReaper.dead_end(); I!=E; ++I) B = F.Remove(B, *I);
+ E = SymReaper.dead_end(); I!=E; ++I) B = F.remove(B, *I);
state = state->set<RefBindings>(B);
Builder.MakeNode(Dst, S, Pred, state);
// Is this entry for a super-region of a changed region?
if (SuperRegions.count(MR)) {
- Entries = F.Remove(Entries, MR);
+ Entries = F.remove(Entries, MR);
continue;
}
while (const SubRegion *SR = dyn_cast<SubRegion>(Super)) {
Super = SR->getSuperRegion();
if (Invalidated.count(Super)) {
- Entries = F.Remove(Entries, MR);
+ Entries = F.remove(Entries, MR);
break;
}
}
SVal Len = I.getData();
if (SymbolRef Sym = Len.getAsSymbol()) {
if (SR.isDead(Sym))
- Entries = F.Remove(Entries, I.getKey());
+ Entries = F.remove(Entries, I.getKey());
}
}
if (V.isUnknown()) {
if (Invalidate)
- return Environment(F.Remove(Env.ExprBindings, S));
+ return Environment(F.remove(Env.ExprBindings, S));
else
return Env;
}
- return Environment(F.Add(Env.ExprBindings, S, V));
+ return Environment(F.add(Env.ExprBindings, S, V));
}
static inline const Stmt *MakeLocation(const Stmt *S) {
Environment EnvironmentManager::bindExprAndLocation(Environment Env,
const Stmt *S,
SVal location, SVal V) {
- return Environment(F.Add(F.Add(Env.ExprBindings, MakeLocation(S), location),
+ return Environment(F.add(F.add(Env.ExprBindings, MakeLocation(S), location),
S, V));
}
// Block-level expressions in callers are assumed always live.
if (isBlockExprInCallers(BlkExpr, SymReaper.getLocationContext())) {
- NewEnv.ExprBindings = F.Add(NewEnv.ExprBindings, BlkExpr, X);
+ NewEnv.ExprBindings = F.add(NewEnv.ExprBindings, BlkExpr, X);
if (isa<loc::MemRegionVal>(X)) {
const MemRegion* R = cast<loc::MemRegionVal>(X).getRegion();
if (SymReaper.isLive(BlkExpr)) {
// Copy the binding to the new map.
- NewEnv.ExprBindings = F.Add(NewEnv.ExprBindings, BlkExpr, X);
+ NewEnv.ExprBindings = F.add(NewEnv.ExprBindings, BlkExpr, X);
// If the block expr's value is a memory region, then mark that region.
if (isa<loc::MemRegionVal>(X)) {
// beginning of itself, but we need its UndefinedVal to determine its
// SVal.
if (X.isUndef() && cast<UndefinedVal>(X).getData())
- NewEnv.ExprBindings = F.Add(NewEnv.ExprBindings, BlkExpr, X);
+ NewEnv.ExprBindings = F.add(NewEnv.ExprBindings, BlkExpr, X);
}
// Go through he deferred locations and add them to the new environment if
I = deferredLocations.begin(), E = deferredLocations.end(); I != E; ++I) {
const Stmt *S = (Stmt*) (((uintptr_t) I->first) & (uintptr_t) ~0x1);
if (NewEnv.ExprBindings.lookup(S))
- NewEnv.ExprBindings = F.Add(NewEnv.ExprBindings, I->first, I->second);
+ NewEnv.ExprBindings = F.add(NewEnv.ExprBindings, I->first, I->second);
}
return NewEnv;
const LocationContext *LC, SVal v);
Store getInitialStore(const LocationContext *InitLoc) {
- return RBFactory.GetEmptyMap().getRoot();
+ return RBFactory.getEmptyMap().getRoot();
}
SubRegionMap *getSubRegionMap(Store store) {
RegionBindings B = getRegionBindings(store);
const BindingVal *BV = B.lookup(RI.R);
if (BV) {
- const SVal *V = BVFactory.Lookup(*BV, RI.I);
+ const SVal *V = BVFactory.lookup(*BV, RI.I);
if (V)
return *V;
else
RegionBindings B = getRegionBindings(store);
const BindingVal *V = B.lookup(R);
- BindingVal BV = BVFactory.GetEmptyMap();
+ BindingVal BV = BVFactory.getEmptyMap();
if (V)
BV = *V;
// FIXME: FlatStore should handle regions with unknown intervals.
if (!RI.R)
return B.getRoot();
- BV = BVFactory.Add(BV, RI.I, val);
- B = RBFactory.Add(B, RI.R, BV);
+ BV = BVFactory.add(BV, RI.I, val);
+ B = RBFactory.add(B, RI.R, BV);
return B.getRoot();
}
GRBlockCounter::Factory::IncrementCount(GRBlockCounter BC,
const StackFrameContext *CallSite,
unsigned BlockID) {
- return GRBlockCounter(GetFactory(F).Add(GetMap(BC.Data),
+ return GRBlockCounter(GetFactory(F).add(GetMap(BC.Data),
CountKey(CallSite, BlockID),
BC.getNumVisited(CallSite, BlockID)+1).getRoot());
}
GRBlockCounter
GRBlockCounter::Factory::GetEmptyCounter() {
- return GRBlockCounter(GetFactory(F).GetEmptyMap().getRoot());
+ return GRBlockCounter(GetFactory(F).getEmptyMap().getRoot());
}
GRState State(this,
EnvMgr.getInitialEnvironment(),
StoreMgr->getInitialStore(InitLoc),
- GDMFactory.GetEmptyMap());
+ GDMFactory.getEmptyMap());
return getPersistentState(State);
}
GRState State(this,
EnvMgr.getInitialEnvironment(),
StoreMgr->getInitialStore(InitLoc),
- GDMFactory.GetEmptyMap());
+ GDMFactory.getEmptyMap());
return getPersistentState(State);
}
const GRState* GRStateManager::addGDM(const GRState* St, void* Key, void* Data){
GRState::GenericDataMap M1 = St->getGDM();
- GRState::GenericDataMap M2 = GDMFactory.Add(M1, Key, Data);
+ GRState::GenericDataMap M2 = GDMFactory.add(M1, Key, Data);
if (M1 == M2)
return St;
const GRState *GRStateManager::removeGDM(const GRState *state, void *Key) {
GRState::GenericDataMap OldM = state->getGDM();
- GRState::GenericDataMap NewM = GDMFactory.Remove(OldM, Key);
+ GRState::GenericDataMap NewM = GDMFactory.remove(OldM, Key);
if (NewM == OldM)
return state;
}
// Remove the dead symbol from the map.
- RS = F.Remove(RS, I->first);
+ RS = F.remove(RS, I->first);
}
}
/// Construct a new RangeSet representing '{ [from, to] }'.
RangeSet(Factory &F, const llvm::APSInt &from, const llvm::APSInt &to)
- : ranges(F.Add(F.GetEmptySet(), Range(from, to))) {}
+ : ranges(F.add(F.getEmptySet(), Range(from, to))) {}
/// Profile - Generates a hash profile of this RangeSet for use
/// by FoldingSet.
if (i->Includes(Lower)) {
if (i->Includes(Upper)) {
- newRanges = F.Add(newRanges, Range(BV.getValue(Lower),
+ newRanges = F.add(newRanges, Range(BV.getValue(Lower),
BV.getValue(Upper)));
break;
} else
- newRanges = F.Add(newRanges, Range(BV.getValue(Lower), i->To()));
+ newRanges = F.add(newRanges, Range(BV.getValue(Lower), i->To()));
} else {
if (i->Includes(Upper)) {
- newRanges = F.Add(newRanges, Range(i->From(), BV.getValue(Upper)));
+ newRanges = F.add(newRanges, Range(i->From(), BV.getValue(Upper)));
break;
} else
- newRanges = F.Add(newRanges, *i);
+ newRanges = F.add(newRanges, *i);
}
}
}
RangeSet Intersect(BasicValueFactory &BV, Factory &F,
const llvm::APSInt &Lower,
const llvm::APSInt &Upper) const {
- PrimRangeSet newRanges = F.GetEmptySet();
+ PrimRangeSet newRanges = F.getEmptySet();
PrimRangeSet::iterator i = begin(), e = end();
if (Lower <= Upper)
for (ConstraintRangeTy::iterator I = CR.begin(), E = CR.end(); I != E; ++I) {
SymbolRef sym = I.getKey();
if (SymReaper.maybeDead(sym))
- CR = CRFactory.Remove(CR, sym);
+ CR = CRFactory.remove(CR, sym);
}
return state->set<ConstraintRange>(CR);
Map::iterator I = M.find(Parent);
if (I == M.end()) {
- M.insert(std::make_pair(Parent, F.Add(F.GetEmptySet(), SubRegion)));
+ M.insert(std::make_pair(Parent, F.add(F.getEmptySet(), SubRegion)));
return true;
}
- I->second = F.Add(I->second, SubRegion);
+ I->second = F.add(I->second, SubRegion);
return false;
}
SVal EvalBinOp(BinaryOperator::Opcode Op,Loc L, NonLoc R, QualType resultTy);
Store getInitialStore(const LocationContext *InitLoc) {
- return RBFactory.GetEmptyMap().getRoot();
+ return RBFactory.getEmptyMap().getRoot();
}
//===-------------------------------------------------------------------===//
void RemoveSubRegionBindings(RegionBindings &B, const MemRegion *R,
RegionStoreSubRegionMap &M);
- RegionBindings Add(RegionBindings B, BindingKey K, SVal V);
+ RegionBindings addBinding(RegionBindings B, BindingKey K, SVal V);
- RegionBindings Add(RegionBindings B, const MemRegion *R,
+ RegionBindings addBinding(RegionBindings B, const MemRegion *R,
BindingKey::Kind k, SVal V);
- const SVal *Lookup(RegionBindings B, BindingKey K);
- const SVal *Lookup(RegionBindings B, const MemRegion *R, BindingKey::Kind k);
+ const SVal *lookup(RegionBindings B, BindingKey K);
+ const SVal *lookup(RegionBindings B, const MemRegion *R, BindingKey::Kind k);
- RegionBindings Remove(RegionBindings B, BindingKey K);
- RegionBindings Remove(RegionBindings B, const MemRegion *R,
+ RegionBindings removeBinding(RegionBindings B, BindingKey K);
+ RegionBindings removeBinding(RegionBindings B, const MemRegion *R,
BindingKey::Kind k);
- RegionBindings Remove(RegionBindings B, const MemRegion *R) {
- return Remove(Remove(B, R, BindingKey::Direct), R, BindingKey::Default);
+ RegionBindings removeBinding(RegionBindings B, const MemRegion *R) {
+ return removeBinding(removeBinding(B, R, BindingKey::Direct), R,
+ BindingKey::Default);
}
public: // Part of public interface to class.
// BindDefault is only used to initialize a region with a default value.
Store BindDefault(Store store, const MemRegion *R, SVal V) {
RegionBindings B = GetRegionBindings(store);
- assert(!Lookup(B, R, BindingKey::Default));
- assert(!Lookup(B, R, BindingKey::Direct));
- return Add(B, R, BindingKey::Default, V).getRoot();
+ assert(!lookup(B, R, BindingKey::Default));
+ assert(!lookup(B, R, BindingKey::Direct));
+ return addBinding(B, R, BindingKey::Default, V).getRoot();
}
Store BindCompoundLiteral(Store store, const CompoundLiteralExpr* CL,
I != E; ++I)
RemoveSubRegionBindings(B, *I, M);
- B = Remove(B, R);
+ B = removeBinding(B, R);
}
namespace {
for ( ; I != E; ++I) {
// Get the old binding. Is it a region? If so, add it to the worklist.
const BindingKey &K = *I;
- if (const SVal *V = RM.Lookup(B, K))
+ if (const SVal *V = RM.lookup(B, K))
VisitBinding(*V);
- B = RM.Remove(B, K);
+ B = RM.removeBinding(B, K);
}
}
if (isa<AllocaRegion>(baseR) || isa<SymbolicRegion>(baseR)) {
// Invalidate the region by setting its default value to
// conjured symbol. The type of the symbol is irrelavant.
- DefinedOrUnknownSVal V = ValMgr.getConjuredSymbolVal(baseR, Ex, Ctx.IntTy,
- Count);
- B = RM.Add(B, baseR, BindingKey::Default, V);
+ DefinedOrUnknownSVal V =
+ ValMgr.getConjuredSymbolVal(baseR, Ex, Ctx.IntTy, Count);
+ B = RM.addBinding(B, baseR, BindingKey::Default, V);
return;
}
// conjured symbol. The type of the symbol is irrelavant.
DefinedOrUnknownSVal V = ValMgr.getConjuredSymbolVal(baseR, Ex, Ctx.IntTy,
Count);
- B = RM.Add(B, baseR, BindingKey::Default, V);
+ B = RM.addBinding(B, baseR, BindingKey::Default, V);
return;
}
// Set the default value of the array to conjured symbol.
DefinedOrUnknownSVal V =
ValMgr.getConjuredSymbolVal(baseR, Ex, AT->getElementType(), Count);
- B = RM.Add(B, baseR, BindingKey::Default, V);
+ B = RM.addBinding(B, baseR, BindingKey::Default, V);
return;
}
// If the region is a global and we are invalidating all globals,
// just erase the entry. This causes all globals to be lazily
// symbolicated from the same base symbol.
- B = RM.Remove(B, baseR);
+ B = RM.removeBinding(B, baseR);
return;
}
DefinedOrUnknownSVal V = ValMgr.getConjuredSymbolVal(baseR, Ex, T, Count);
assert(SymbolManager::canSymbolicate(T) || V.isUnknown());
- B = RM.Add(B, baseR, BindingKey::Direct, V);
+ B = RM.addBinding(B, baseR, BindingKey::Direct, V);
}
Store RegionStoreManager::InvalidateRegions(Store store,
ValMgr.getConjuredSymbolVal(/* SymbolTag = */ (void*) GS, Ex,
/* symbol type, doesn't matter */ Ctx.IntTy,
Count);
- B = Add(B, BindingKey::Make(GS, BindingKey::Default), V);
+ B = addBinding(B, BindingKey::Make(GS, BindingKey::Default), V);
// Even if there are no bindings in the global scope, we still need to
// record that we touched it.
Optional<SVal> RegionStoreManager::getDirectBinding(RegionBindings B,
const MemRegion *R) {
- if (const SVal *V = Lookup(B, R, BindingKey::Direct))
+ if (const SVal *V = lookup(B, R, BindingKey::Direct))
return *V;
return Optional<SVal>();
if (TR->getValueType()->isUnionType())
return UnknownVal();
- if (const SVal *V = Lookup(B, R, BindingKey::Default))
+ if (const SVal *V = lookup(B, R, BindingKey::Default))
return *V;
return Optional<SVal>();
}
RegionBindings B = GetRegionBindings(store);
- const SVal *V = Lookup(B, R, BindingKey::Direct);
+ const SVal *V = lookup(B, R, BindingKey::Direct);
// Check if the region has a binding.
if (V)
Store RegionStoreManager::Remove(Store store, Loc L) {
if (isa<loc::MemRegionVal>(L))
if (const MemRegion* R = cast<loc::MemRegionVal>(L).getRegion())
- return Remove(GetRegionBindings(store), R).getRoot();
+ return removeBinding(GetRegionBindings(store), R).getRoot();
return store;
}
// Perform the binding.
RegionBindings B = GetRegionBindings(store);
- return Add(B, R, BindingKey::Direct, V).getRoot();
+ return addBinding(B, R, BindingKey::Direct, V).getRoot();
}
Store RegionStoreManager::BindDecl(Store store, const VarRegion *VR,
return store;
}
- return Add(B, R, BindingKey::Default, V).getRoot();
+ return addBinding(B, R, BindingKey::Default, V).getRoot();
}
Store RegionStoreManager::BindArray(Store store, const TypedRegion* R,
// There may be fewer values in the initialize list than the fields of struct.
if (FI != FE) {
RegionBindings B = GetRegionBindings(store);
- B = Add(B, R, BindingKey::Default, ValMgr.makeIntVal(0, false));
+ B = addBinding(B, R, BindingKey::Default, ValMgr.makeIntVal(0, false));
store = B.getRoot();
}
RemoveSubRegionBindings(B, R, *SubRegions);
// Set the default value of the struct region to "unknown".
- return Add(B, R, BindingKey::Default, DefaultVal).getRoot();
+ return addBinding(B, R, BindingKey::Default, DefaultVal).getRoot();
}
Store RegionStoreManager::CopyLazyBindings(nonloc::LazyCompoundVal V,
// Now copy the bindings. This amounts to just binding 'V' to 'R'. This
// results in a zero-copy algorithm.
- return Add(B, R, BindingKey::Direct, V).getRoot();
+ return addBinding(B, R, BindingKey::Direct, V).getRoot();
}
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
-RegionBindings RegionStoreManager::Add(RegionBindings B, BindingKey K, SVal V) {
+RegionBindings RegionStoreManager::addBinding(RegionBindings B, BindingKey K,
+ SVal V) {
if (!K.isValid())
return B;
- return RBFactory.Add(B, K, V);
+ return RBFactory.add(B, K, V);
}
-RegionBindings RegionStoreManager::Add(RegionBindings B, const MemRegion *R,
- BindingKey::Kind k, SVal V) {
- return Add(B, BindingKey::Make(R, k), V);
+RegionBindings RegionStoreManager::addBinding(RegionBindings B,
+ const MemRegion *R,
+ BindingKey::Kind k, SVal V) {
+ return addBinding(B, BindingKey::Make(R, k), V);
}
-const SVal *RegionStoreManager::Lookup(RegionBindings B, BindingKey K) {
+const SVal *RegionStoreManager::lookup(RegionBindings B, BindingKey K) {
if (!K.isValid())
return NULL;
return B.lookup(K);
}
-const SVal *RegionStoreManager::Lookup(RegionBindings B,
+const SVal *RegionStoreManager::lookup(RegionBindings B,
const MemRegion *R,
BindingKey::Kind k) {
- return Lookup(B, BindingKey::Make(R, k));
+ return lookup(B, BindingKey::Make(R, k));
}
-RegionBindings RegionStoreManager::Remove(RegionBindings B, BindingKey K) {
+RegionBindings RegionStoreManager::removeBinding(RegionBindings B,
+ BindingKey K) {
if (!K.isValid())
return B;
- return RBFactory.Remove(B, K);
+ return RBFactory.remove(B, K);
}
-RegionBindings RegionStoreManager::Remove(RegionBindings B, const MemRegion *R,
- BindingKey::Kind k){
- return Remove(B, BindingKey::Make(R, k));
+RegionBindings RegionStoreManager::removeBinding(RegionBindings B,
+ const MemRegion *R,
+ BindingKey::Kind k){
+ return removeBinding(B, BindingKey::Make(R, k));
}
//===----------------------------------------------------------------------===//
}
// Visit the data binding for K.
- if (const SVal *V = RM.Lookup(B, K))
+ if (const SVal *V = RM.lookup(B, K))
VisitBinding(*V);
}
continue;
// Remove the dead entry.
- B = Remove(B, K);
+ B = removeBinding(B, K);
// Mark all non-live symbols that this binding references as dead.
if (const SymbolicRegion* SymR = dyn_cast<SymbolicRegion>(K.getRegion()))