Fix a misuse of iterators when iterating through block's

parameters list for encoding.

llvm-svn: 100788
This commit is contained in:
Fariborz Jahanian 2010-04-08 18:06:22 +00:00
parent 386e01e879
commit 590c3524ac
1 changed files with 2 additions and 2 deletions

View File

@ -3192,7 +3192,7 @@ std::string charUnitsToString(const CharUnits &CU) {
return llvm::itostr(CU.getQuantity()); return llvm::itostr(CU.getQuantity());
} }
/// getObjCEncodingForBlockDecl - Return the encoded type for this method /// getObjCEncodingForBlockDecl - Return the encoded type for this block
/// declaration. /// declaration.
void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr, void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr,
std::string& S) { std::string& S) {
@ -3207,7 +3207,7 @@ void ASTContext::getObjCEncodingForBlock(const BlockExpr *Expr,
SourceLocation Loc; SourceLocation Loc;
CharUnits PtrSize = getTypeSizeInChars(VoidPtrTy); CharUnits PtrSize = getTypeSizeInChars(VoidPtrTy);
CharUnits ParmOffset = PtrSize; 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) { E = Decl->param_end(); PI != E; ++PI) {
QualType PType = (*PI)->getType(); QualType PType = (*PI)->getType();
CharUnits sz = getObjCEncodingTypeSize(PType); CharUnits sz = getObjCEncodingTypeSize(PType);