Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146618 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index e754e73..7436745 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -690,7 +690,7 @@
       // Note! I deliberately want it to fall thru so, we have a
       // a property implementation and to avoid future warnings.
     } else if (getLangOptions().ObjCNonFragileABI &&
-               ClassDeclared != IDecl) {
+               !declaresSameEntity(ClassDeclared, IDecl)) {
       Diag(PropertyLoc, diag::error_ivar_in_superclass_use)
       << property->getDeclName() << Ivar->getDeclName()
       << ClassDeclared->getDeclName();
@@ -870,7 +870,7 @@
       }
       // Issue diagnostics only if Ivar belongs to current class.
       if (Ivar && Ivar->getSynthesize() && 
-          IC->getClassInterface() == ClassDeclared) {
+          declaresSameEntity(IC->getClassInterface(), ClassDeclared)) {
         Diag(Ivar->getLocation(), diag::err_undeclared_var_use) 
         << PropertyId;
         Ivar->setInvalidDecl();