From: Mike Stump Date: Wed, 22 Jul 2009 18:58:19 +0000 (+0000) Subject: Use isa instead of dyn_cast for conditionals. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e1fab243ab8023b7ee3899745386b3b3a4258f8;p=clang Use isa instead of dyn_cast for conditionals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76771 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index 705939be72..d489d4e73f 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -2527,7 +2527,7 @@ void ASTContext::getObjCEncodingForPropertyDecl(const ObjCPropertyDecl *PD, /// 'i' or 'I' instead if encoding a struct field, or a pointer! /// void ASTContext::getLegacyIntegralTypeEncoding (QualType &PointeeTy) const { - if (dyn_cast(PointeeTy.getTypePtr())) { + if (isa(PointeeTy.getTypePtr())) { if (const BuiltinType *BT = PointeeTy->getAsBuiltinType()) { if (BT->getKind() == BuiltinType::ULong && ((const_cast(this))->getIntWidth(PointeeTy) == 32)) @@ -2617,7 +2617,7 @@ void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S, // pointee gets emitted _before_ the '^'. The read-only qualifier of // the pointer itself gets ignored, _unless_ we are looking at a typedef! // Also, do not emit the 'r' for anything but the outermost type! - if (dyn_cast(T.getTypePtr())) { + if (isa(T.getTypePtr())) { if (OutermostType && T.isConstQualified()) { isReadOnly = true; S += 'r'; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 6ad2040b9d..8c780296a7 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1495,7 +1495,7 @@ bool Sema::CheckAlignOfExpr(Expr *E, SourceLocation OpLoc, // Alignment of a field access is always okay, so long as it isn't a // bit-field. if (MemberExpr *ME = dyn_cast(E)) - if (dyn_cast(ME->getMemberDecl())) + if (isa(ME->getMemberDecl())) return false; return CheckSizeOfAlignOfOperand(E->getType(), OpLoc, ExprRange, false);