From d1b6c770bea9b3da66c6c1eb9a7c483ed7e55c1e Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 29 Jan 2017 20:58:47 +0000 Subject: Vendor import of clang release_40 branch r293443: https://llvm.org/svn/llvm-project/cfe/branches/release_40@293443 --- lib/Index/IndexDecl.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/Index/IndexDecl.cpp') diff --git a/lib/Index/IndexDecl.cpp b/lib/Index/IndexDecl.cpp index 7d60aad3895d..3b4f3f81399d 100644 --- a/lib/Index/IndexDecl.cpp +++ b/lib/Index/IndexDecl.cpp @@ -92,7 +92,13 @@ public: Relations.emplace_back((unsigned)SymbolRole::RelationAccessorOf, AssociatedProp); - if (!IndexCtx.handleDecl(D, (unsigned)SymbolRole::Dynamic, Relations)) + // getLocation() returns beginning token of a method declaration, but for + // indexing purposes we want to point to the base name. + SourceLocation MethodLoc = D->getSelectorStartLoc(); + if (MethodLoc.isInvalid()) + MethodLoc = D->getLocation(); + + if (!IndexCtx.handleDecl(D, MethodLoc, (unsigned)SymbolRole::Dynamic, Relations)) return false; IndexCtx.indexTypeSourceInfo(D->getReturnTypeSourceInfo(), D); bool hasIBActionAndFirst = D->hasAttr(); -- cgit v1.3