summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
committerpatrick <patrick@openbsd.org>2017-03-14 08:07:52 +0000
commit1cb66ada17adf0954eaadba4d02ec2470365a3ac (patch)
tree521159d8f39562a43fffd680147eb5a71709b9b1 /gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp
parentMark the sshd_config UsePrivilegeSeparation option as deprecated, (diff)
downloadwireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.tar.xz
wireguard-openbsd-1cb66ada17adf0954eaadba4d02ec2470365a3ac.zip
Import LLVM 4.0.0 release including clang and lld.
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp')
-rw-r--r--gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp b/gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp
index 7d60aad3895..3b4f3f81399 100644
--- a/gnu/llvm/tools/clang/lib/Index/IndexDecl.cpp
+++ b/gnu/llvm/tools/clang/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>();