diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-02-20 18:43:26 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-02-20 18:43:26 +0000 |
| commit | a499715c83601ae105c317c1858fd91657d5e191 (patch) | |
| tree | 537c35b979893da1ee759723efff12b99366f7e6 /clang/lib/AST | |
| parent | 87d5ca083b8b8b684d98f897a2157ac00087ef75 (diff) | |
| download | bcm5719-llvm-a499715c83601ae105c317c1858fd91657d5e191.tar.gz bcm5719-llvm-a499715c83601ae105c317c1858fd91657d5e191.zip | |
remove some more methods from objc decls, using the iterator
interfaces more consistently.
llvm-svn: 65138
Diffstat (limited to 'clang/lib/AST')
| -rw-r--r-- | clang/lib/AST/ASTContext.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index b8c74e13965..9ed62510894 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -1858,10 +1858,10 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, // The first two arguments (self and _cmd) are pointers; account for // their size. int ParmOffset = 2 * PtrSize; - int NumOfParams = Decl->getNumParams(); - for (int i = 0; i < NumOfParams; i++) { - QualType PType = Decl->getParamDecl(i)->getType(); - int sz = getObjCEncodingTypeSize (PType); + for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(), + E = Decl->param_end(); PI != E; ++PI) { + QualType PType = (*PI)->getType(); + int sz = getObjCEncodingTypeSize(PType); assert (sz > 0 && "getObjCEncodingForMethodDecl - Incomplete param type"); ParmOffset += sz; } @@ -1871,8 +1871,9 @@ void ASTContext::getObjCEncodingForMethodDecl(const ObjCMethodDecl *Decl, // Argument types. ParmOffset = 2 * PtrSize; - for (int i = 0; i < NumOfParams; i++) { - ParmVarDecl *PVDecl = Decl->getParamDecl(i); + for (ObjCMethodDecl::param_iterator PI = Decl->param_begin(), + E = Decl->param_end(); PI != E; ++PI) { + ParmVarDecl *PVDecl = *PI; QualType PType = PVDecl->getOriginalType(); if (const ArrayType *AT = dyn_cast<ArrayType>(PType->getCanonicalTypeInternal())) |

