[cfe-commits] r120071 - in /cfe/trunk: include/clang/Checker/BugReporter/ include/clang/Checker/PathSensitive/ lib/Checker/
Ted Kremenek
kremenek at apple.com
Tue Nov 23 16:54:37 PST 2010
Author: kremenek
Date: Tue Nov 23 18:54:37 2010
New Revision: 120071
URL: http://llvm.org/viewvc/llvm-project?rev=120071&view=rev
Log:
Adjust method calls to reflect name changes in
ImmutableSet/ImmtuableMap/ImmutableList APIs.
Along the way, clean up some method names in
the static analyzer so that they are more
descriptive and/or start with lowercase letters.
Modified:
cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h
cfe/trunk/include/clang/Checker/PathSensitive/BasicValueFactory.h
cfe/trunk/include/clang/Checker/PathSensitive/Environment.h
cfe/trunk/include/clang/Checker/PathSensitive/GRStateTrait.h
cfe/trunk/lib/Checker/BasicConstraintManager.cpp
cfe/trunk/lib/Checker/BasicStore.cpp
cfe/trunk/lib/Checker/BugReporter.cpp
cfe/trunk/lib/Checker/CFRefCount.cpp
cfe/trunk/lib/Checker/CStringChecker.cpp
cfe/trunk/lib/Checker/Environment.cpp
cfe/trunk/lib/Checker/FlatStore.cpp
cfe/trunk/lib/Checker/GRBlockCounter.cpp
cfe/trunk/lib/Checker/GRState.cpp
cfe/trunk/lib/Checker/MallocChecker.cpp
cfe/trunk/lib/Checker/RangeConstraintManager.cpp
cfe/trunk/lib/Checker/RegionStore.cpp
Modified: cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h (original)
+++ cfe/trunk/include/clang/Checker/BugReporter/BugReporter.h Tue Nov 23 18:54:37 2010
@@ -282,11 +282,11 @@
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();
@@ -399,7 +399,7 @@
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);
Modified: cfe/trunk/include/clang/Checker/PathSensitive/BasicValueFactory.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/BasicValueFactory.h?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/BasicValueFactory.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/BasicValueFactory.h Tue Nov 23 18:54:37 2010
@@ -172,11 +172,11 @@
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,
Modified: cfe/trunk/include/clang/Checker/PathSensitive/Environment.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/Environment.h?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/Environment.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/Environment.h Tue Nov 23 18:54:37 2010
@@ -80,7 +80,7 @@
~EnvironmentManager() {}
Environment getInitialEnvironment() {
- return Environment(F.GetEmptyMap());
+ return Environment(F.getEmptyMap());
}
/// Bind the value 'V' to the statement 'S'.
Modified: cfe/trunk/include/clang/Checker/PathSensitive/GRStateTrait.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Checker/PathSensitive/GRStateTrait.h?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/include/clang/Checker/PathSensitive/GRStateTrait.h (original)
+++ cfe/trunk/include/clang/Checker/PathSensitive/GRStateTrait.h Tue Nov 23 18:54:37 2010
@@ -48,11 +48,11 @@
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) {
@@ -86,11 +86,11 @@
}
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) {
@@ -119,7 +119,7 @@
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) {
Modified: cfe/trunk/lib/Checker/BasicConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BasicConstraintManager.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BasicConstraintManager.cpp (original)
+++ cfe/trunk/lib/Checker/BasicConstraintManager.cpp Tue Nov 23 18:54:37 2010
@@ -237,10 +237,10 @@
// 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);
@@ -281,7 +281,8 @@
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);
@@ -290,7 +291,8 @@
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);
Modified: cfe/trunk/lib/Checker/BasicStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BasicStore.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BasicStore.cpp (original)
+++ cfe/trunk/lib/Checker/BasicStore.cpp Tue Nov 23 18:54:37 2010
@@ -218,7 +218,7 @@
// 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
@@ -256,8 +256,8 @@
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) {
@@ -269,7 +269,7 @@
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.");
@@ -394,7 +394,7 @@
// 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;
Modified: cfe/trunk/lib/Checker/BugReporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/BugReporter.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/BugReporter.cpp (original)
+++ cfe/trunk/lib/Checker/BugReporter.cpp Tue Nov 23 18:54:37 2010
@@ -51,7 +51,7 @@
}
CallbacksSet.InsertNode(visitor, InsertPos);
- Callbacks = F.Add(visitor, Callbacks);
+ Callbacks = F.add(visitor, Callbacks);
}
//===----------------------------------------------------------------------===//
@@ -1333,7 +1333,7 @@
}
// Remove all references to the BugType objects.
- BugTypes = F.GetEmptySet();
+ BugTypes = F.getEmptySet();
}
//===----------------------------------------------------------------------===//
@@ -1615,7 +1615,7 @@
}
void BugReporter::Register(BugType *BT) {
- BugTypes = F.Add(BugTypes, BT);
+ BugTypes = F.add(BugTypes, BT);
}
void BugReporter::EmitReport(BugReport* R) {
Modified: cfe/trunk/lib/Checker/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CFRefCount.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Checker/CFRefCount.cpp Tue Nov 23 18:54:37 2010
@@ -762,7 +762,7 @@
}
void addPanicSummary(const char* Cls, ...) {
- RetainSummary* Summ = getPersistentSummary(AF.GetEmptyMap(),
+ RetainSummary* Summ = getPersistentSummary(AF.getEmptyMap(),
RetEffect::MakeNoRet(),
DoNothing, DoNothing, true);
va_list argp;
@@ -776,12 +776,12 @@
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 */),
@@ -881,7 +881,7 @@
ArgEffects RetainSummaryManager::getArgEffects() {
ArgEffects AE = ScratchArgs;
- ScratchArgs = AF.GetEmptyMap();
+ ScratchArgs = AF.getEmptyMap();
return AE;
}
@@ -967,13 +967,13 @@
// 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>
@@ -982,14 +982,14 @@
// 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") {
@@ -998,7 +998,7 @@
// 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);
}
@@ -1129,19 +1129,19 @@
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);
}
@@ -1156,8 +1156,8 @@
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));
@@ -1263,7 +1263,7 @@
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);
}
}
@@ -1432,7 +1432,7 @@
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));
@@ -1627,10 +1627,10 @@
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);
}
@@ -3016,7 +3016,7 @@
// 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());
}
}
@@ -3345,7 +3345,7 @@
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);
Modified: cfe/trunk/lib/Checker/CStringChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/CStringChecker.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/CStringChecker.cpp (original)
+++ cfe/trunk/lib/Checker/CStringChecker.cpp Tue Nov 23 18:54:37 2010
@@ -1004,7 +1004,7 @@
// 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;
}
@@ -1013,7 +1013,7 @@
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;
}
}
@@ -1049,7 +1049,7 @@
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());
}
}
Modified: cfe/trunk/lib/Checker/Environment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/Environment.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/Environment.cpp (original)
+++ cfe/trunk/lib/Checker/Environment.cpp Tue Nov 23 18:54:37 2010
@@ -86,12 +86,12 @@
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) {
@@ -101,7 +101,7 @@
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));
}
@@ -175,7 +175,7 @@
// 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();
@@ -194,7 +194,7 @@
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)) {
@@ -213,7 +213,7 @@
// 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
@@ -222,7 +222,7 @@
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;
Modified: cfe/trunk/lib/Checker/FlatStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/FlatStore.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/FlatStore.cpp (original)
+++ cfe/trunk/lib/Checker/FlatStore.cpp Tue Nov 23 18:54:37 2010
@@ -36,7 +36,7 @@
const LocationContext *LC, SVal v);
Store getInitialStore(const LocationContext *InitLoc) {
- return RBFactory.GetEmptyMap().getRoot();
+ return RBFactory.getEmptyMap().getRoot();
}
SubRegionMap *getSubRegionMap(Store store) {
@@ -97,7 +97,7 @@
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
@@ -119,7 +119,7 @@
RegionBindings B = getRegionBindings(store);
const BindingVal *V = B.lookup(R);
- BindingVal BV = BVFactory.GetEmptyMap();
+ BindingVal BV = BVFactory.getEmptyMap();
if (V)
BV = *V;
@@ -127,8 +127,8 @@
// 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();
}
Modified: cfe/trunk/lib/Checker/GRBlockCounter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRBlockCounter.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRBlockCounter.cpp (original)
+++ cfe/trunk/lib/Checker/GRBlockCounter.cpp Tue Nov 23 18:54:37 2010
@@ -74,12 +74,12 @@
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());
}
Modified: cfe/trunk/lib/Checker/GRState.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/GRState.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/GRState.cpp (original)
+++ cfe/trunk/lib/Checker/GRState.cpp Tue Nov 23 18:54:37 2010
@@ -64,7 +64,7 @@
GRState State(this,
EnvMgr.getInitialEnvironment(),
StoreMgr->getInitialStore(InitLoc),
- GDMFactory.GetEmptyMap());
+ GDMFactory.getEmptyMap());
return getPersistentState(State);
}
@@ -278,7 +278,7 @@
GRState State(this,
EnvMgr.getInitialEnvironment(),
StoreMgr->getInitialStore(InitLoc),
- GDMFactory.GetEmptyMap());
+ GDMFactory.getEmptyMap());
return getPersistentState(State);
}
@@ -420,7 +420,7 @@
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;
@@ -432,7 +432,7 @@
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;
Modified: cfe/trunk/lib/Checker/MallocChecker.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/MallocChecker.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/MallocChecker.cpp (original)
+++ cfe/trunk/lib/Checker/MallocChecker.cpp Tue Nov 23 18:54:37 2010
@@ -587,7 +587,7 @@
}
// Remove the dead symbol from the map.
- RS = F.Remove(RS, I->first);
+ RS = F.remove(RS, I->first);
}
}
Modified: cfe/trunk/lib/Checker/RangeConstraintManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/RangeConstraintManager.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/RangeConstraintManager.cpp (original)
+++ cfe/trunk/lib/Checker/RangeConstraintManager.cpp Tue Nov 23 18:54:37 2010
@@ -91,7 +91,7 @@
/// 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.
@@ -129,17 +129,17 @@
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);
}
}
}
@@ -155,7 +155,7 @@
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)
@@ -274,7 +274,7 @@
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);
Modified: cfe/trunk/lib/Checker/RegionStore.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/RegionStore.cpp?rev=120071&r1=120070&r2=120071&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/RegionStore.cpp (original)
+++ cfe/trunk/lib/Checker/RegionStore.cpp Tue Nov 23 18:54:37 2010
@@ -148,11 +148,11 @@
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;
}
@@ -227,7 +227,7 @@
SVal EvalBinOp(BinaryOperator::Opcode Op,Loc L, NonLoc R, QualType resultTy);
Store getInitialStore(const LocationContext *InitLoc) {
- return RBFactory.GetEmptyMap().getRoot();
+ return RBFactory.getEmptyMap().getRoot();
}
//===-------------------------------------------------------------------===//
@@ -247,20 +247,21 @@
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.
@@ -270,9 +271,9 @@
// 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,
@@ -560,7 +561,7 @@
I != E; ++I)
RemoveSubRegionBindings(B, *I, M);
- B = Remove(B, R);
+ B = removeBinding(B, R);
}
namespace {
@@ -622,10 +623,10 @@
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);
}
}
@@ -657,9 +658,9 @@
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;
}
@@ -675,7 +676,7 @@
// 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;
}
@@ -683,7 +684,7 @@
// 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;
}
@@ -692,14 +693,14 @@
// 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,
@@ -733,7 +734,7 @@
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.
@@ -929,7 +930,7 @@
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>();
@@ -942,7 +943,7 @@
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>();
@@ -1038,7 +1039,7 @@
}
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)
@@ -1339,7 +1340,7 @@
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;
}
@@ -1385,7 +1386,7 @@
// 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,
@@ -1430,7 +1431,7 @@
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,
@@ -1541,7 +1542,7 @@
// 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();
}
@@ -1556,7 +1557,7 @@
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,
@@ -1573,7 +1574,7 @@
// 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();
}
//===----------------------------------------------------------------------===//
@@ -1581,38 +1582,42 @@
//===----------------------------------------------------------------------===//
-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));
}
//===----------------------------------------------------------------------===//
@@ -1738,7 +1743,7 @@
}
// Visit the data binding for K.
- if (const SVal *V = RM.Lookup(B, K))
+ if (const SVal *V = RM.lookup(B, K))
VisitBinding(*V);
}
@@ -1787,7 +1792,7 @@
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()))
More information about the cfe-commits
mailing list