diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-29 20:58:47 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-29 20:58:47 +0000 |
| commit | d1b6c770bea9b3da66c6c1eb9a7c483ed7e55c1e (patch) | |
| tree | fe0f8eccf127c346ac2e08e36ec2af95072f4458 /lib/Index/IndexDecl.cpp | |
| parent | 865493b10990f9932c79d135eef448ff418792ab (diff) | |
Notes
Diffstat (limited to 'lib/Index/IndexDecl.cpp')
| -rw-r--r-- | lib/Index/IndexDecl.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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<IBActionAttr>(); |
