[cfe-commits] r45604 - in /cfe/trunk/Sema: Sema.h SemaExprObjC.cpp SemaStmt.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Jan 4 15:59:09 PST 2008


Author: fjahanian
Date: Fri Jan  4 17:59:09 2008
New Revision: 45604

URL: http://llvm.org/viewvc/llvm-project?rev=45604&view=rev
Log:
Minor refactoring of foreach's semantics code per Chris's suggetion.

Modified:
    cfe/trunk/Sema/Sema.h
    cfe/trunk/Sema/SemaExprObjC.cpp
    cfe/trunk/Sema/SemaStmt.cpp

Modified: cfe/trunk/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/Sema.h?rev=45604&r1=45603&r2=45604&view=diff

==============================================================================
--- cfe/trunk/Sema/Sema.h (original)
+++ cfe/trunk/Sema/Sema.h Fri Jan  4 17:59:09 2008
@@ -286,7 +286,7 @@
   /// or "Protocol".
   bool isBuiltinObjcType(TypedefDecl *TD);
   
-  /// isObjcObjectPointerType - Returns tru if type is an objective-c pointer
+  /// isObjcObjectPointerType - Returns true if type is an objective-c pointer
   /// to an object type; such as "id", "Class", Intf*, id<P>, etc.
   bool isObjcObjectPointerType(QualType type) const;
 

Modified: cfe/trunk/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaExprObjC.cpp?rev=45604&r1=45603&r2=45604&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/Sema/SemaExprObjC.cpp Fri Jan  4 17:59:09 2008
@@ -217,7 +217,7 @@
           return true;
     }
   } else {
-    bool receiverIsQualId = dyn_cast<ObjcQualifiedIdType>(receiverType) != 0;
+    bool receiverIsQualId = isa<ObjcQualifiedIdType>(receiverType);
     // FIXME (snaroff): checking in this code from Patrick. Needs to be
     // revisited. how do we get the ClassDecl from the receiver expression?
     if (!receiverIsQualId)

Modified: cfe/trunk/Sema/SemaStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaStmt.cpp?rev=45604&r1=45603&r2=45604&view=diff

==============================================================================
--- cfe/trunk/Sema/SemaStmt.cpp (original)
+++ cfe/trunk/Sema/SemaStmt.cpp Fri Jan  4 17:59:09 2008
@@ -540,15 +540,15 @@
   Stmt *Body  = static_cast<Stmt*>(body);
   QualType FirstType;
   if (DeclStmt *DS = dyn_cast_or_null<DeclStmt>(First)) {
-    FirstType = dyn_cast<ValueDecl>(DS->getDecl())->getType();
+    FirstType = cast<ValueDecl>(DS->getDecl())->getType();
     // C99 6.8.5p3: The declaration part of a 'for' statement shall only declare
     // identifiers for objects having storage class 'auto' or 'register'.
     for (ScopedDecl *D = DS->getDecl(); D; D = D->getNextDeclarator()) {
-      BlockVarDecl *BVD = dyn_cast<BlockVarDecl>(D);
+      BlockVarDecl *BVD = cast<BlockVarDecl>(D);
       if (BVD && !BVD->hasLocalStorage())
         BVD = 0;
       if (BVD == 0)
-        return Diag(dyn_cast<ScopedDecl>(D)->getLocation(), 
+        return Diag(cast<ScopedDecl>(D)->getLocation(), 
                     diag::err_non_variable_decl_in_for);
     }
   }





More information about the cfe-commits mailing list