[AST] When we @synthesize a property with a user-defined ivar name,
make sure to record the source location of the ivar name.
[libclang] When indexing @synthesized objc methods, report the @implementation
as the lexical container.

Fixes rdar://10905472

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151635 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/libclang/IndexDecl.cpp b/tools/libclang/IndexDecl.cpp
index 2bd7129..3f2c8b5 100644
--- a/tools/libclang/IndexDecl.cpp
+++ b/tools/libclang/IndexDecl.cpp
@@ -216,11 +216,13 @@
 
     if (ObjCMethodDecl *MD = PD->getGetterMethodDecl()) {
       if (MD->isSynthesized())
-        IndexCtx.handleSynthesizedObjCMethod(MD, D->getLocation());
+        IndexCtx.handleSynthesizedObjCMethod(MD, D->getLocation(),
+                                             D->getLexicalDeclContext());
     }
     if (ObjCMethodDecl *MD = PD->getSetterMethodDecl()) {
       if (MD->isSynthesized())
-        IndexCtx.handleSynthesizedObjCMethod(MD, D->getLocation());
+        IndexCtx.handleSynthesizedObjCMethod(MD, D->getLocation(),
+                                             D->getLexicalDeclContext());
     }
     return true;
   }