aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core
diff options
context:
space:
mode:
authorZhanyong Wan <wan@google.com>2011-02-16 21:13:32 +0000
committerZhanyong Wan <wan@google.com>2011-02-16 21:13:32 +0000
commit7dfc9420babe83e236a47e752f8723bd06070d9d (patch)
treefd5184bcf498744899117777eecc9df7ace6d122 /lib/StaticAnalyzer/Core
parentd24eda8ad42bea6b36400d5505f67a7917d65652 (diff)
Makes most methods in SVals.h conform to the naming guide. Reviewed
by kremenek. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125687 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core')
-rw-r--r--lib/StaticAnalyzer/Core/BasicStore.cpp4
-rw-r--r--lib/StaticAnalyzer/Core/BasicValueFactory.cpp4
-rw-r--r--lib/StaticAnalyzer/Core/BugReporter.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/CFRefCount.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/GRState.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/ObjCMessage.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/RegionStore.cpp2
-rw-r--r--lib/StaticAnalyzer/Core/SValBuilder.cpp26
-rw-r--r--lib/StaticAnalyzer/Core/SVals.cpp4
-rw-r--r--lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp4
-rw-r--r--lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp8
-rw-r--r--lib/StaticAnalyzer/Core/SymbolManager.cpp2
12 files changed, 30 insertions, 32 deletions
diff --git a/lib/StaticAnalyzer/Core/BasicStore.cpp b/lib/StaticAnalyzer/Core/BasicStore.cpp
index 105b505242..987e790585 100644
--- a/lib/StaticAnalyzer/Core/BasicStore.cpp
+++ b/lib/StaticAnalyzer/Core/BasicStore.cpp
@@ -252,7 +252,7 @@ Store BasicStoreManager::Bind(Store store, Loc loc, SVal V) {
// a pointer. We may wish to flag a type error here if the types
// are incompatible. This may also cause lots of breakage
// elsewhere. Food for thought.
- if (TyR->isBoundable() && Loc::IsLocType(TyR->getValueType()))
+ if (TyR->isBoundable() && Loc::isLocType(TyR->getValueType()))
V = X->getLoc();
}
@@ -464,7 +464,7 @@ Store BasicStoreManager::BindDeclInternal(Store store, const VarRegion* VR,
// unsigned) zero;
if (!InitVal) {
QualType T = VD->getType();
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
store = Bind(store, loc::MemRegionVal(VR),
loc::ConcreteInt(BasicVals.getValue(0, T)));
else if (T->isIntegerType() && T->isScalarType())
diff --git a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
index 7eb2fe4dc5..6315d83d89 100644
--- a/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
+++ b/lib/StaticAnalyzer/Core/BasicValueFactory.cpp
@@ -99,7 +99,7 @@ const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, unsigned BitWidth,
const llvm::APSInt& BasicValueFactory::getValue(uint64_t X, QualType T) {
unsigned bits = Ctx.getTypeSize(T);
- llvm::APSInt V(bits, T->isUnsignedIntegerType() || Loc::IsLocType(T));
+ llvm::APSInt V(bits, T->isUnsignedIntegerType() || Loc::isLocType(T));
V = X;
return getValue(V);
}
@@ -286,5 +286,3 @@ BasicValueFactory::getPersistentSValPair(const SVal& V1, const SVal& V2) {
const SVal* BasicValueFactory::getPersistentSVal(SVal X) {
return &getPersistentSValWithData(X, 0).first;
}
-
-
diff --git a/lib/StaticAnalyzer/Core/BugReporter.cpp b/lib/StaticAnalyzer/Core/BugReporter.cpp
index 431c5d7506..d945639ee4 100644
--- a/lib/StaticAnalyzer/Core/BugReporter.cpp
+++ b/lib/StaticAnalyzer/Core/BugReporter.cpp
@@ -446,7 +446,7 @@ public:
// Create the diagnostic.
FullSourceLoc L(S->getLocStart(), BR.getSourceManager());
- if (Loc::IsLocType(VD->getType())) {
+ if (Loc::isLocType(VD->getType())) {
std::string msg = "'" + std::string(VD->getNameAsString()) +
"' now aliases '" + MostRecent->getNameAsString() + "'";
diff --git a/lib/StaticAnalyzer/Core/CFRefCount.cpp b/lib/StaticAnalyzer/Core/CFRefCount.cpp
index 92bd4116a7..b3721d7659 100644
--- a/lib/StaticAnalyzer/Core/CFRefCount.cpp
+++ b/lib/StaticAnalyzer/Core/CFRefCount.cpp
@@ -2679,7 +2679,7 @@ void CFRefCount::evalSummary(ExplodedNodeSet& Dst,
// that are returned by value.
QualType T = callOrMsg.getResultType(Eng.getContext());
- if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())) {
+ if (Loc::isLocType(T) || (T->isIntegerType() && T->isScalarType())) {
unsigned Count = Builder.getCurrentBlockCount();
SValBuilder &svalBuilder = Eng.getSValBuilder();
SVal X = svalBuilder.getConjuredSymbolVal(NULL, Ex, T, Count);
diff --git a/lib/StaticAnalyzer/Core/GRState.cpp b/lib/StaticAnalyzer/Core/GRState.cpp
index 80f2ae082b..80c8bbf195 100644
--- a/lib/StaticAnalyzer/Core/GRState.cpp
+++ b/lib/StaticAnalyzer/Core/GRState.cpp
@@ -165,7 +165,7 @@ SVal GRState::getSValAsScalarOrLoc(const MemRegion *R) const {
if (const TypedRegion *TR = dyn_cast<TypedRegion>(R)) {
QualType T = TR->getValueType();
- if (Loc::IsLocType(T) || T->isIntegerType())
+ if (Loc::isLocType(T) || T->isIntegerType())
return getSVal(R);
}
diff --git a/lib/StaticAnalyzer/Core/ObjCMessage.cpp b/lib/StaticAnalyzer/Core/ObjCMessage.cpp
index a27a5b6be8..2e370d62e4 100644
--- a/lib/StaticAnalyzer/Core/ObjCMessage.cpp
+++ b/lib/StaticAnalyzer/Core/ObjCMessage.cpp
@@ -93,7 +93,7 @@ SVal CallOrObjCMessage::getArgSValAsScalarOrLoc(unsigned i) const {
assert(i < getNumArgs());
if (CallE) return State->getSValAsScalarOrLoc(CallE->getArg(i));
QualType argT = Msg.getArgType(i);
- if (Loc::IsLocType(argT) || argT->isIntegerType())
+ if (Loc::isLocType(argT) || argT->isIntegerType())
return Msg.getArgSVal(i, State);
return UnknownVal();
}
diff --git a/lib/StaticAnalyzer/Core/RegionStore.cpp b/lib/StaticAnalyzer/Core/RegionStore.cpp
index a6a55933ad..dc31715ccb 100644
--- a/lib/StaticAnalyzer/Core/RegionStore.cpp
+++ b/lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1333,7 +1333,7 @@ Store RegionStoreManager::setImplicitDefaultValue(Store store,
RegionBindings B = GetRegionBindings(store);
SVal V;
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
V = svalBuilder.makeNull();
else if (T->isIntegerType())
V = svalBuilder.makeZeroVal(T);
diff --git a/lib/StaticAnalyzer/Core/SValBuilder.cpp b/lib/StaticAnalyzer/Core/SValBuilder.cpp
index b2ffcbda71..796613383b 100644
--- a/lib/StaticAnalyzer/Core/SValBuilder.cpp
+++ b/lib/StaticAnalyzer/Core/SValBuilder.cpp
@@ -26,7 +26,7 @@ using namespace ento;
//===----------------------------------------------------------------------===//
DefinedOrUnknownSVal SValBuilder::makeZeroVal(QualType T) {
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return makeNull();
if (T->isIntegerType())
@@ -43,14 +43,14 @@ NonLoc SValBuilder::makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
// The Environment ensures we always get a persistent APSInt in
// BasicValueFactory, so we don't need to get the APSInt from
// BasicValueFactory again.
- assert(!Loc::IsLocType(T));
+ assert(!Loc::isLocType(T));
return nonloc::SymExprVal(SymMgr.getSymIntExpr(lhs, op, v, T));
}
NonLoc SValBuilder::makeNonLoc(const SymExpr *lhs, BinaryOperator::Opcode op,
const SymExpr *rhs, QualType T) {
assert(SymMgr.getType(lhs) == SymMgr.getType(rhs));
- assert(!Loc::IsLocType(T));
+ assert(!Loc::isLocType(T));
return nonloc::SymExprVal(SymMgr.getSymSymExpr(lhs, op, rhs, T));
}
@@ -78,7 +78,7 @@ SValBuilder::getRegionValueSymbolVal(const TypedRegion* R) {
SymbolRef sym = SymMgr.getRegionValueSymbol(R);
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym));
return nonloc::SymbolVal(sym);
@@ -94,7 +94,7 @@ DefinedOrUnknownSVal SValBuilder::getConjuredSymbolVal(const void *SymbolTag,
SymbolRef sym = SymMgr.getConjuredSymbol(E, Count, SymbolTag);
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym));
return nonloc::SymbolVal(sym);
@@ -110,7 +110,7 @@ DefinedOrUnknownSVal SValBuilder::getConjuredSymbolVal(const void *SymbolTag,
SymbolRef sym = SymMgr.getConjuredSymbol(E, T, Count, SymbolTag);
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym));
return nonloc::SymbolVal(sym);
@@ -124,7 +124,7 @@ DefinedSVal SValBuilder::getMetadataSymbolVal(const void *SymbolTag,
SymbolRef sym = SymMgr.getMetadataSymbol(MR, E, T, Count, SymbolTag);
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym));
return nonloc::SymbolVal(sym);
@@ -140,7 +140,7 @@ SValBuilder::getDerivedRegionValueSymbolVal(SymbolRef parentSymbol,
SymbolRef sym = SymMgr.getDerivedSymbol(parentSymbol, R);
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return loc::MemRegionVal(MemMgr.getSymbolicRegion(sym));
return nonloc::SymbolVal(sym);
@@ -216,11 +216,11 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
return evalCastNL(cast<NonLoc>(val), castTy);
// Check for casts from pointers to integers.
- if (castTy->isIntegerType() && Loc::IsLocType(originalTy))
+ if (castTy->isIntegerType() && Loc::isLocType(originalTy))
return evalCastL(cast<Loc>(val), castTy);
// Check for casts from integers to pointers.
- if (Loc::IsLocType(castTy) && originalTy->isIntegerType()) {
+ if (Loc::isLocType(castTy) && originalTy->isIntegerType()) {
if (nonloc::LocAsInteger *LV = dyn_cast<nonloc::LocAsInteger>(&val)) {
if (const MemRegion *R = LV->getLoc().getAsRegion()) {
StoreManager &storeMgr = StateMgr.getStoreManager();
@@ -234,7 +234,7 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
// Just pass through function and block pointers.
if (originalTy->isBlockPointerType() || originalTy->isFunctionPointerType()) {
- assert(Loc::IsLocType(castTy));
+ assert(Loc::isLocType(castTy));
return val;
}
@@ -264,7 +264,7 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
// FIXME: We should handle the case where we strip off view layers to get
// to a desugared type.
- if (!Loc::IsLocType(castTy)) {
+ if (!Loc::isLocType(castTy)) {
// FIXME: There can be gross cases where one casts the result of a function
// (that returns a pointer) to some other value that happens to fit
// within that pointer value. We currently have no good way to
@@ -291,7 +291,7 @@ SVal SValBuilder::evalCast(SVal val, QualType castTy, QualType originalTy) {
// return bar(x)+1; // no-warning
// }
- assert(Loc::IsLocType(originalTy) || originalTy->isFunctionType() ||
+ assert(Loc::isLocType(originalTy) || originalTy->isFunctionType() ||
originalTy->isBlockPointerType());
StoreManager &storeMgr = StateMgr.getStoreManager();
diff --git a/lib/StaticAnalyzer/Core/SVals.cpp b/lib/StaticAnalyzer/Core/SVals.cpp
index cc7231bc2c..cc866d0127 100644
--- a/lib/StaticAnalyzer/Core/SVals.cpp
+++ b/lib/StaticAnalyzer/Core/SVals.cpp
@@ -68,7 +68,7 @@ SymbolRef SVal::getAsLocSymbol() const {
return X->getLoc().getAsLocSymbol();
if (const loc::MemRegionVal *X = dyn_cast<loc::MemRegionVal>(this)) {
- const MemRegion *R = X->StripCasts();
+ const MemRegion *R = X->stripCasts();
if (const SymbolicRegion *SymR = dyn_cast<SymbolicRegion>(R))
return SymR->getSymbol();
}
@@ -128,7 +128,7 @@ const MemRegion *SVal::getAsRegion() const {
return 0;
}
-const MemRegion *loc::MemRegionVal::StripCasts() const {
+const MemRegion *loc::MemRegionVal::stripCasts() const {
const MemRegion *R = getRegion();
return R ? R->StripCasts() : NULL;
}
diff --git a/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp b/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
index cca32e7b86..e0b61ab580 100644
--- a/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
+++ b/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp
@@ -261,9 +261,9 @@ const GRState *SimpleConstraintManager::assumeSymRel(const GRState *state,
ASTContext &Ctx = StateMgr.getContext();
QualType T = Sym->getType(Ctx);
- assert(T->isIntegerType() || Loc::IsLocType(T));
+ assert(T->isIntegerType() || Loc::isLocType(T));
unsigned bitwidth = Ctx.getTypeSize(T);
- bool isSymUnsigned = T->isUnsignedIntegerType() || Loc::IsLocType(T);
+ bool isSymUnsigned = T->isUnsignedIntegerType() || Loc::isLocType(T);
// Convert the adjustment.
Adjustment.setIsUnsigned(isSymUnsigned);
diff --git a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
index 2642f58cd6..9a46bd6d69 100644
--- a/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
+++ b/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp
@@ -59,7 +59,7 @@ SValBuilder *ento::createSimpleSValBuilder(llvm::BumpPtrAllocator &alloc,
SVal SimpleSValBuilder::evalCastNL(NonLoc val, QualType castTy) {
- bool isLocType = Loc::IsLocType(castTy);
+ bool isLocType = Loc::isLocType(castTy);
if (nonloc::LocAsInteger *LI = dyn_cast<nonloc::LocAsInteger>(&val)) {
if (isLocType)
@@ -97,7 +97,7 @@ SVal SimpleSValBuilder::evalCastNL(NonLoc val, QualType castTy) {
return UnknownVal();
llvm::APSInt i = cast<nonloc::ConcreteInt>(val).getValue();
- i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::IsLocType(castTy));
+ i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::isLocType(castTy));
i = i.extOrTrunc(Context.getTypeSize(castTy));
if (isLocType)
@@ -114,7 +114,7 @@ SVal SimpleSValBuilder::evalCastL(Loc val, QualType castTy) {
// can be introduced by the frontend for corner cases, e.g
// casting from va_list* to __builtin_va_list&.
//
- if (Loc::IsLocType(castTy) || castTy->isReferenceType())
+ if (Loc::isLocType(castTy) || castTy->isReferenceType())
return val;
// FIXME: Handle transparent unions where a value can be "transparently"
@@ -129,7 +129,7 @@ SVal SimpleSValBuilder::evalCastL(Loc val, QualType castTy) {
return makeLocAsInteger(val, BitWidth);
llvm::APSInt i = cast<loc::ConcreteInt>(val).getValue();
- i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::IsLocType(castTy));
+ i.setIsUnsigned(castTy->isUnsignedIntegerType() || Loc::isLocType(castTy));
i = i.extOrTrunc(BitWidth);
return makeIntVal(i);
}
diff --git a/lib/StaticAnalyzer/Core/SymbolManager.cpp b/lib/StaticAnalyzer/Core/SymbolManager.cpp
index f4ed806402..c1ca1cfcdc 100644
--- a/lib/StaticAnalyzer/Core/SymbolManager.cpp
+++ b/lib/StaticAnalyzer/Core/SymbolManager.cpp
@@ -235,7 +235,7 @@ SymbolManager::~SymbolManager() {}
bool SymbolManager::canSymbolicate(QualType T) {
T = T.getCanonicalType();
- if (Loc::IsLocType(T))
+ if (Loc::isLocType(T))
return true;
if (T->isIntegerType())