]> granicus.if.org Git - clang/commitdiff
Minor refactoring of foreach's semantics code per Chris's suggetion.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 4 Jan 2008 23:59:09 +0000 (23:59 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 4 Jan 2008 23:59:09 +0000 (23:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45604 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/Sema.h
Sema/SemaExprObjC.cpp
Sema/SemaStmt.cpp

index d8871d2a38a4d212456f5eabb82653359122c39c..bc74fd171be84d171ce773d80b9eeb5a27fabe57 100644 (file)
@@ -286,7 +286,7 @@ private:
   /// 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;
 
index e976876c2b3ce9668d04370b990c52a66b7b4b43..a82f6fb493e77dbf9f7c93dad2345ebc39bf3fcb 100644 (file)
@@ -217,7 +217,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage(
           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)
index a983036b9933bfbdf368dd0a837159c68c1f3fe4..81eb0b0060f26b8f05e91e437b47cc2d7c165225 100644 (file)
@@ -540,15 +540,15 @@ Sema::ActOnObjcForCollectionStmt(SourceLocation ForColLoc,
   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);
     }
   }