diff --git a/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 45deed69dce0..450fdc55f6c4 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/include/clang/AST/DeclObjC.h @@ -407,7 +407,6 @@ public: } ObjCCategoryDecl *FindCategoryDeclaration(IdentifierInfo *CategoryId) const; - ObjCIvarDecl *FindIvarDeclaration(IdentifierInfo *IvarId) const; typedef ObjCList::iterator protocol_iterator; protocol_iterator protocol_begin() const {return ReferencedProtocols.begin();} diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index ce745bc6b874..162ead60f894 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -233,22 +233,6 @@ ObjCCategoryDecl * return 0; } -/// FindIvarDeclaration - Find an Ivar declaration in this class given its -/// name in 'IvarId'. On failure to find, return 0; -/// -ObjCIvarDecl * - ObjCInterfaceDecl::FindIvarDeclaration(IdentifierInfo *IvarId) const { - for (ObjCInterfaceDecl::ivar_iterator IVI = ivar_begin(), - IVE = ivar_end(); IVI != IVE; ++IVI) { - ObjCIvarDecl* Ivar = (*IVI); - if (Ivar->getIdentifier() == IvarId) - return Ivar; - } - if (getSuperClass()) - return getSuperClass()->FindIvarDeclaration(IvarId); - return 0; -} - /// ObjCAddInstanceVariablesToClass - Inserts instance variables /// into ObjCInterfaceDecl's fields. /// diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index de438c3394e5..3f31a33c8030 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3660,7 +3660,7 @@ void Sema::ActOnFields(Scope* S, IVE = ID->ivar_end(); IVI != IVE; ++IVI) { ObjCIvarDecl* Ivar = (*IVI); IdentifierInfo *II = Ivar->getIdentifier(); - ObjCIvarDecl* prevIvar = ID->getSuperClass()->FindIvarDeclaration(II); + ObjCIvarDecl* prevIvar = ID->getSuperClass()->lookupInstanceVariable(II); if (prevIvar) { Diag(Ivar->getLocation(), diag::err_duplicate_member) << II; Diag(prevIvar->getLocation(), diag::note_previous_declaration); diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index dc8ce062f0b4..1c9594a9702d 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -1698,7 +1698,7 @@ Sema::DeclTy *Sema::ActOnPropertyImplDecl(SourceLocation AtLoc, if (!PropertyIvar) PropertyIvar = PropertyId; // Check that this is a previously declared 'ivar' in 'IDecl' interface - Ivar = IDecl->FindIvarDeclaration(PropertyIvar); + Ivar = IDecl->lookupInstanceVariable(PropertyIvar); if (!Ivar) { Diag(PropertyLoc, diag::error_missing_property_ivar_decl) << PropertyId; return 0;