case Decl::ObjCProtocol:
return Sema::OCK_Protocol;
case Decl::ObjCCategory:
- if (dyn_cast<ObjCCategoryDecl>(CurContext)->IsClassExtension())
+ if (cast<ObjCCategoryDecl>(CurContext)->IsClassExtension())
return Sema::OCK_ClassExtension;
- else
- return Sema::OCK_Category;
+ return Sema::OCK_Category;
case Decl::ObjCImplementation:
return Sema::OCK_Implementation;
case Decl::ObjCCategoryImpl:
NamedDecl *D = *I;
if (D->isCXXInstanceMember()) {
- if (dyn_cast<FieldDecl>(D) || dyn_cast<MSPropertyDecl>(D)
- || dyn_cast<IndirectFieldDecl>(D))
- isField = true;
+ isField |= isa<FieldDecl>(D) || isa<MSPropertyDecl>(D) ||
+ isa<IndirectFieldDecl>(D);
CXXRecordDecl *R = cast<CXXRecordDecl>(D->getDeclContext());
Classes.insert(R->getCanonicalDecl());
}
}
}
- else if (isa<MemberExpr>(E)) {
+ else if (const auto *ME = dyn_cast<MemberExpr>(E)) {
// No points-to analysis, just look at the member
- const Decl * EmeMD = dyn_cast<MemberExpr>(E)->getMemberDecl();
+ const Decl *EmeMD = ME->getMemberDecl();
while (i != e) {
--i;
- if (isa<MemberExpr>(i->variable)) {
- if (dyn_cast<MemberExpr>(i->variable)->getMemberDecl() == EmeMD)
+ if (const auto *ME_i = dyn_cast<MemberExpr>(i->variable)) {
+ if (ME_i->getMemberDecl() == EmeMD)
i = toScanFor.erase (i);
}
}