Remove FindIvarDeclaration. Use lookupInstanceVariable is is functionally
the same.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64657 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h
index 45deed6..450fdc5 100644
--- a/include/clang/AST/DeclObjC.h
+++ b/include/clang/AST/DeclObjC.h
@@ -407,7 +407,6 @@
}
ObjCCategoryDecl *FindCategoryDeclaration(IdentifierInfo *CategoryId) const;
- ObjCIvarDecl *FindIvarDeclaration(IdentifierInfo *IvarId) const;
typedef ObjCList<ObjCProtocolDecl>::iterator protocol_iterator;
protocol_iterator protocol_begin() const {return ReferencedProtocols.begin();}
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp
index ce745bc..162ead6 100644
--- a/lib/AST/DeclObjC.cpp
+++ b/lib/AST/DeclObjC.cpp
@@ -233,22 +233,6 @@
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/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index de438c3..3f31a33 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3660,7 +3660,7 @@
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/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index dc8ce06..1c9594a 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1698,7 +1698,7 @@
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;