aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
committerTed Kremenek <kremenek@apple.com>2009-07-29 21:53:49 +0000
commit6217b80b7a1379b74cced1c076338262c3c980b3 (patch)
tree771e3d3432ec70a00de34956f44a930a3012bc72 /lib/Analysis/RegionStore.cpp
parentf7a0cf426eddae76e1a71dd2295631a2cf0560af (diff)
Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/RegionStore.cpp')
-rw-r--r--lib/Analysis/RegionStore.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/Analysis/RegionStore.cpp b/lib/Analysis/RegionStore.cpp
index ccfbb27ccf..d79c4c5fcf 100644
--- a/lib/Analysis/RegionStore.cpp
+++ b/lib/Analysis/RegionStore.cpp
@@ -379,7 +379,7 @@ static bool isGenericPtr(ASTContext &Ctx, QualType Ty) {
if (Ty->isVoidType())
return true;
- if (const PointerType *PT = Ty->getAsPointerType()) {
+ if (const PointerType *PT = Ty->getAs<PointerType>()) {
Ty = PT->getPointeeType();
continue;
}
@@ -455,7 +455,7 @@ const GRState *RegionStoreManager::InvalidateRegion(const GRState *state,
// If the region is cast to another type, use that type.
if (const QualType *CastTy = getCastType(state, R)) {
assert(!(*CastTy)->isObjCObjectPointerType());
- QualType NewT = (*CastTy)->getAsPointerType()->getPointeeType();
+ QualType NewT = (*CastTy)->getAs<PointerType>()->getPointeeType();
// The only exception is if the original region had a location type as its
// value type we always want to treat the region as binding to a location.
@@ -790,7 +790,7 @@ SVal RegionStoreManager::EvalBinOp(const GRState *state,
T = Sym->getType(getContext());
}
- QualType EleTy = T->getAsPointerType()->getPointeeType();
+ QualType EleTy = T->getAs<PointerType>()->getPointeeType();
SVal ZeroIdx = ValMgr.makeZeroArrayIndex();
ER = MRMgr.getElementRegion(EleTy, ZeroIdx, SR, getContext());
break;
@@ -799,7 +799,7 @@ SVal RegionStoreManager::EvalBinOp(const GRState *state,
// Get the alloca region's current cast type.
const AllocaRegion *AR = cast<AllocaRegion>(MR);
QualType T = *(state->get<RegionCasts>(AR));
- QualType EleTy = T->getAsPointerType()->getPointeeType();
+ QualType EleTy = T->getAs<PointerType>()->getPointeeType();
SVal ZeroIdx = ValMgr.makeZeroArrayIndex();
ER = MRMgr.getElementRegion(EleTy, ZeroIdx, AR, getContext());
break;
@@ -869,8 +869,8 @@ static bool IsReinterpreted(QualType RTy, QualType UsedTy, ASTContext &Ctx) {
// is ever reinterpreted as a non-pointer, e.g. void** and intptr_t*
// represents a reinterpretation.
if (Loc::IsLocType(RTy) && Loc::IsLocType(UsedTy)) {
- const PointerType *PRTy = RTy->getAsPointerType();
- const PointerType *PUsedTy = UsedTy->getAsPointerType();
+ const PointerType *PRTy = RTy->getAs<PointerType>();
+ const PointerType *PUsedTy = UsedTy->getAs<PointerType>();
return PUsedTy && PRTy &&
IsReinterpreted(PRTy->getPointeeType(),
@@ -982,7 +982,7 @@ RegionStoreManager::Retrieve(const GRState *state, Loc L, QualType T) {
// symbol value.
if (const QualType *p = state->get<RegionCasts>(R)) {
QualType T = *p;
- RTy = T->getAsPointerType()->getPointeeType();
+ RTy = T->getAs<PointerType>()->getPointeeType();
}
#endif
@@ -1062,7 +1062,7 @@ SVal RegionStoreManager::RetrieveElement(const GRState* state,
// If the region is already cast to another type, use that type to create the
// symbol value.
if (const QualType *p = state->get<RegionCasts>(R))
- Ty = (*p)->getAsPointerType()->getPointeeType();
+ Ty = (*p)->getAs<PointerType>()->getPointeeType();
#endif
return ValMgr.getRegionValueSymbolValOrUnknown(R, Ty);
@@ -1105,7 +1105,7 @@ SVal RegionStoreManager::RetrieveField(const GRState* state,
// symbol value.
if (const QualType *p = state->get<RegionCasts>(R)) {
QualType tmp = *p;
- Ty = tmp->getAsPointerType()->getPointeeType();
+ Ty = tmp->getAs<PointerType>()->getPointeeType();
}
#endif
@@ -1166,7 +1166,7 @@ SVal RegionStoreManager::RetrieveLazySymbol(const GRState *state,
// If the region is already cast to another type, use that type to create the
// symbol value.
if (const QualType *ty = state->get<RegionCasts>(R)) {
- if (const PointerType *PT = (*ty)->getAsPointerType()) {
+ if (const PointerType *PT = (*ty)->getAs<PointerType>()) {
QualType castTy = PT->getPointeeType();
if (!IsReinterpreted(valTy, castTy, getContext()))
@@ -1374,7 +1374,7 @@ RegionStoreManager::BindStruct(const GRState *state, const TypedRegion* R,
QualType T = R->getValueType(getContext());
assert(T->isStructureType());
- const RecordType* RT = T->getAsRecordType();
+ const RecordType* RT = T->getAs<RecordType>();
RecordDecl* RD = RT->getDecl();
if (!RD->isDefinition())