[cfe-commits] r76771 - in /cfe/trunk/lib: AST/ASTContext.cpp Sema/SemaExpr.cpp

Mike Stump mrs at apple.com
Wed Jul 22 11:58:19 PDT 2009


Author: mrs
Date: Wed Jul 22 13:58:19 2009
New Revision: 76771

URL: http://llvm.org/viewvc/llvm-project?rev=76771&view=rev
Log:
Use isa instead of dyn_cast for conditionals.

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=76771&r1=76770&r2=76771&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Jul 22 13:58:19 2009
@@ -2527,7 +2527,7 @@
 /// 'i' or 'I' instead if encoding a struct field, or a pointer!
 ///
 void ASTContext::getLegacyIntegralTypeEncoding (QualType &PointeeTy) const {
-  if (dyn_cast<TypedefType>(PointeeTy.getTypePtr())) {
+  if (isa<TypedefType>(PointeeTy.getTypePtr())) {
     if (const BuiltinType *BT = PointeeTy->getAsBuiltinType()) {
       if (BT->getKind() == BuiltinType::ULong &&
           ((const_cast<ASTContext *>(this))->getIntWidth(PointeeTy) == 32))
@@ -2617,7 +2617,7 @@
     // 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<TypedefType>(T.getTypePtr())) {
+    if (isa<TypedefType>(T.getTypePtr())) {
       if (OutermostType && T.isConstQualified()) {
         isReadOnly = true;
         S += 'r';

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=76771&r1=76770&r2=76771&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Wed Jul 22 13:58:19 2009
@@ -1495,7 +1495,7 @@
   // Alignment of a field access is always okay, so long as it isn't a
   // bit-field.
   if (MemberExpr *ME = dyn_cast<MemberExpr>(E))
-    if (dyn_cast<FieldDecl>(ME->getMemberDecl()))
+    if (isa<FieldDecl>(ME->getMemberDecl()))
       return false;
 
   return CheckSizeOfAlignOfOperand(E->getType(), OpLoc, ExprRange, false);





More information about the cfe-commits mailing list