From: Fariborz Jahanian Date: Fri, 4 Jan 2008 23:59:09 +0000 (+0000) Subject: Minor refactoring of foreach's semantics code per Chris's suggetion. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a517e40853c4eb65fe7105f0ff87f38265f05eb0;p=clang Minor refactoring of foreach's semantics code per Chris's suggetion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45604 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/Sema.h b/Sema/Sema.h index d8871d2a38..bc74fd171b 100644 --- a/Sema/Sema.h +++ b/Sema/Sema.h @@ -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

, etc. bool isObjcObjectPointerType(QualType type) const; diff --git a/Sema/SemaExprObjC.cpp b/Sema/SemaExprObjC.cpp index e976876c2b..a82f6fb493 100644 --- a/Sema/SemaExprObjC.cpp +++ b/Sema/SemaExprObjC.cpp @@ -217,7 +217,7 @@ Sema::ExprResult Sema::ActOnInstanceMessage( return true; } } else { - bool receiverIsQualId = dyn_cast(receiverType) != 0; + bool receiverIsQualId = isa(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) diff --git a/Sema/SemaStmt.cpp b/Sema/SemaStmt.cpp index a983036b99..81eb0b0060 100644 --- a/Sema/SemaStmt.cpp +++ b/Sema/SemaStmt.cpp @@ -540,15 +540,15 @@ Sema::ActOnObjcForCollectionStmt(SourceLocation ForColLoc, Stmt *Body = static_cast(body); QualType FirstType; if (DeclStmt *DS = dyn_cast_or_null(First)) { - FirstType = dyn_cast(DS->getDecl())->getType(); + FirstType = cast(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(D); + BlockVarDecl *BVD = cast(D); if (BVD && !BVD->hasLocalStorage()) BVD = 0; if (BVD == 0) - return Diag(dyn_cast(D)->getLocation(), + return Diag(cast(D)->getLocation(), diag::err_non_variable_decl_in_for); } }