diff options
Diffstat (limited to 'AST/Decl.cpp')
-rw-r--r-- | AST/Decl.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/AST/Decl.cpp b/AST/Decl.cpp index 1e3636c2d5..f986c63014 100644 --- a/AST/Decl.cpp +++ b/AST/Decl.cpp @@ -393,12 +393,11 @@ ObjcIvarDecl *ObjcInterfaceDecl::lookupInstanceVariable( IdentifierInfo *ID, ObjcInterfaceDecl *&clsDeclared) { ObjcInterfaceDecl* ClassDecl = this; while (ClassDecl != NULL) { - ObjcIvarDecl **ivars = ClassDecl->getInstanceVariables(); - int ivarCount = ClassDecl->getNumInstanceVariables(); - for (int i = 0; i < ivarCount; ++i) { - if (ivars[i]->getIdentifier() == ID) { + for (ivar_iterator I = ClassDecl->ivar_begin(), E = ClassDecl->ivar_end(); + I != E; ++I) { + if ((*I)->getIdentifier() == ID) { clsDeclared = ClassDecl; - return ivars[i]; + return *I; } } ClassDecl = ClassDecl->getSuperClass(); |