From: Fariborz Jahanian Date: Thu, 8 Apr 2010 18:06:22 +0000 (+0000) Subject: Fix a misuse of iterators when iterating through block's X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f46c2653c1545cc3fef0c0df996d18160160ce8;p=clang Fix a misuse of iterators when iterating through block's parameters list for encoding. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100788 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index f265f8e8a7..513bbd3871 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -3192,7 +3192,7 @@ std::string charUnitsToString(const CharUnits &CU) { return llvm::itostr(CU.getQuantity()); } -/// getObjCEncodingForBlockDecl - Return the encoded type for this method +/// getObjCEncodingForBlockDecl - Return the encoded type for this block /// declaration. void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr, std::string& S) { @@ -3207,7 +3207,7 @@ void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr, SourceLocation Loc; CharUnits PtrSize = getTypeSizeInChars(VoidPtrTy); CharUnits ParmOffset = PtrSize; - for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(), + for (BlockDecl::param_const_iterator PI = Decl->param_begin(), E = Decl->param_end(); PI != E; ++PI) { QualType PType = (*PI)->getType(); CharUnits sz = getObjCEncodingTypeSize(PType);