summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/BasicStore.cpp2
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp6
-rw-r--r--clang/lib/Analysis/CheckNSError.cpp4
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp4
-rw-r--r--clang/lib/Analysis/RegionStore.cpp22
-rw-r--r--clang/lib/Analysis/Store.cpp4
6 files changed, 21 insertions, 21 deletions
diff --git a/clang/lib/Analysis/BasicStore.cpp b/clang/lib/Analysis/BasicStore.cpp
index a898147102f..2b70a964267 100644
--- a/clang/lib/Analysis/BasicStore.cpp
+++ b/clang/lib/Analysis/BasicStore.cpp
@@ -249,7 +249,7 @@ SVal BasicStoreManager::getLValueElement(const GRState *state,
static bool isHigherOrderRawPtr(QualType T, ASTContext &C) {
bool foundPointer = false;
while (1) {
- const PointerType *PT = T->getAsPointerType();
+ const PointerType *PT = T->getAs<PointerType>();
if (!PT) {
if (!foundPointer)
return false;
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index 78d1a8b3e57..eb15644edd6 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -248,7 +248,7 @@ static bool isRefType(QualType RetTy, const char* prefix,
return false;
// Is the type void*?
- const PointerType* PT = RetTy->getAsPointerType();
+ const PointerType* PT = RetTy->getAs<PointerType>();
if (!(PT->getPointeeType().getUnqualifiedType() == Ctx->VoidTy))
return false;
@@ -1251,7 +1251,7 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
}
}
- else if (RetTy->getAsPointerType()) {
+ else if (RetTy->getAs<PointerType>()) {
if (FD->getAttr<CFReturnsRetainedAttr>()) {
Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
}
@@ -1277,7 +1277,7 @@ RetainSummaryManager::updateSummaryFromAnnotations(RetainSummary &Summ,
}
if (!isTrackedLoc)
- isTrackedLoc = MD->getResultType()->getAsPointerType() != NULL;
+ isTrackedLoc = MD->getResultType()->getAs<PointerType>() != NULL;
if (isTrackedLoc && MD->getAttr<CFReturnsRetainedAttr>())
Summ.setRetEffect(RetEffect::MakeOwned(RetEffect::CF, true));
diff --git a/clang/lib/Analysis/CheckNSError.cpp b/clang/lib/Analysis/CheckNSError.cpp
index c1382d03774..4e8ba01e3e2 100644
--- a/clang/lib/Analysis/CheckNSError.cpp
+++ b/clang/lib/Analysis/CheckNSError.cpp
@@ -161,7 +161,7 @@ NSErrorCheck::CheckSignature(FunctionDecl& F, QualType& ResultTy,
bool NSErrorCheck::CheckNSErrorArgument(QualType ArgTy) {
- const PointerType* PPT = ArgTy->getAsPointerType();
+ const PointerType* PPT = ArgTy->getAs<PointerType>();
if (!PPT)
return false;
@@ -182,7 +182,7 @@ bool NSErrorCheck::CheckNSErrorArgument(QualType ArgTy) {
bool NSErrorCheck::CheckCFErrorArgument(QualType ArgTy) {
- const PointerType* PPT = ArgTy->getAsPointerType();
+ const PointerType* PPT = ArgTy->getAs<PointerType>();
if (!PPT) return false;
const TypedefType* TT = PPT->getPointeeType()->getAsTypedefType();
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index ee8865b6358..6431ec7ace6 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -1316,7 +1316,7 @@ static bool EvalOSAtomicCompareAndSwap(ExplodedNodeSet<GRState>& Dst,
return false;
Expr *theValueExpr = CE->getArg(2);
- const PointerType *theValueType = theValueExpr->getType()->getAsPointerType();
+ const PointerType *theValueType = theValueExpr->getType()->getAs<PointerType>();
// theValueType not a pointer?
if (!theValueType)
@@ -1439,7 +1439,7 @@ void GRExprEngine::VisitCall(CallExpr* CE, NodeTy* Pred,
// Determine the type of function we're calling (if available).
const FunctionProtoType *Proto = NULL;
QualType FnType = CE->getCallee()->IgnoreParens()->getType();
- if (const PointerType *FnTypePtr = FnType->getAsPointerType())
+ if (const PointerType *FnTypePtr = FnType->getAs<PointerType>())
Proto = FnTypePtr->getPointeeType()->getAsFunctionProtoType();
VisitCallRec(CE, Pred, AI, AE, Dst, Proto, /*ParamIdx=*/0);
diff --git a/clang/lib/Analysis/RegionStore.cpp b/clang/lib/Analysis/RegionStore.cpp
index ccfbb27ccf2..d79c4c5fcf0 100644
--- a/clang/lib/Analysis/RegionStore.cpp
+++ b/clang/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())
diff --git a/clang/lib/Analysis/Store.cpp b/clang/lib/Analysis/Store.cpp
index 4341abdc725..68bb49cbe30 100644
--- a/clang/lib/Analysis/Store.cpp
+++ b/clang/lib/Analysis/Store.cpp
@@ -34,7 +34,7 @@ StoreManager::MakeElementRegion(const GRState *state, const MemRegion *region,
}
static bool IsCompleteType(ASTContext &Ctx, QualType Ty) {
- if (const RecordType *RT = Ty->getAsRecordType()) {
+ if (const RecordType *RT = Ty->getAs<RecordType>()) {
const RecordDecl *D = RT->getDecl();
if (!D->getDefinition(Ctx))
return false;
@@ -77,7 +77,7 @@ StoreManager::CastRegion(const GRState *state, const MemRegion* R,
// Now assume we are casting from pointer to pointer. Other cases should
// already be handled.
- QualType PointeeTy = CastToTy->getAsPointerType()->getPointeeType();
+ QualType PointeeTy = CastToTy->getAs<PointerType>()->getPointeeType();
// Process region cast according to the kind of the region being cast.
switch (R->getKind()) {
OpenPOWER on IntegriCloud