Implement typo correction for a variety of Objective-C-specific
constructs:

  - Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
  - Property name lookup ("foo.prop")
  - Superclasses
  - Various places where a class name is required
  - Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92449 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index 2e31e47..85889fa 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -287,7 +287,8 @@
   SourceLocation &receiverNameLoc,
   SourceLocation &propertyNameLoc) {
 
-  ObjCInterfaceDecl *IFace = getObjCInterfaceDecl(&receiverName);
+  IdentifierInfo *receiverNamePtr = &receiverName;
+  ObjCInterfaceDecl *IFace = getObjCInterfaceDecl(receiverNamePtr);
 
   // Search for a declared property first.
 
@@ -400,7 +401,7 @@
       return Diag(receiverLoc, diag::err_undeclared_var_use) << receiverName;
     }
   } else
-    ClassDecl = getObjCInterfaceDecl(receiverName);
+    ClassDecl = getObjCInterfaceDecl(receiverName, receiverLoc);
 
   // The following code allows for the following GCC-ism:
   //