diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2017-01-26 02:11:50 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2017-01-26 02:11:50 +0000 |
commit | aee15fb20445c2402ff3cda24318195a9603aa9a (patch) | |
tree | 04af8b211eaa3f77fc54b0acf75935091a1457a8 /clang/tools/libclang/CXIndexDataConsumer.cpp | |
parent | 647d34fe6170dbfe962c9d1b7c4e2f6bd9a6b3fb (diff) | |
download | bcm5719-llvm-aee15fb20445c2402ff3cda24318195a9603aa9a.tar.gz bcm5719-llvm-aee15fb20445c2402ff3cda24318195a9603aa9a.zip |
[index] When indexing an ObjC method declaration use its base name for the location.
Instead of using the location of the beginning '-'/'+'.
This is consistent with location used for function decls and ObjC method calls where we use the base name as the location as well.
llvm-svn: 293134
Diffstat (limited to 'clang/tools/libclang/CXIndexDataConsumer.cpp')
-rw-r--r-- | clang/tools/libclang/CXIndexDataConsumer.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/tools/libclang/CXIndexDataConsumer.cpp b/clang/tools/libclang/CXIndexDataConsumer.cpp index 1981cabbbe4..cb8aebfd0c4 100644 --- a/clang/tools/libclang/CXIndexDataConsumer.cpp +++ b/clang/tools/libclang/CXIndexDataConsumer.cpp @@ -95,7 +95,7 @@ public: if (isa<ObjCImplDecl>(LexicalDC) && !D->isThisDeclarationADefinition()) DataConsumer.handleSynthesizedObjCMethod(D, DeclLoc, LexicalDC); else - DataConsumer.handleObjCMethod(D); + DataConsumer.handleObjCMethod(D, DeclLoc); return true; } @@ -801,7 +801,8 @@ bool CXIndexDataConsumer::handleObjCCategoryImpl(const ObjCCategoryImplDecl *D) return handleObjCContainer(D, CategoryLoc, getCursor(D), CatDInfo); } -bool CXIndexDataConsumer::handleObjCMethod(const ObjCMethodDecl *D) { +bool CXIndexDataConsumer::handleObjCMethod(const ObjCMethodDecl *D, + SourceLocation Loc) { bool isDef = D->isThisDeclarationADefinition(); bool isContainer = isDef; bool isSkipped = false; @@ -814,7 +815,7 @@ bool CXIndexDataConsumer::handleObjCMethod(const ObjCMethodDecl *D) { DeclInfo DInfo(!D->isCanonicalDecl(), isDef, isContainer); if (isSkipped) DInfo.flags |= CXIdxDeclFlag_Skipped; - return handleDecl(D, D->getLocation(), getCursor(D), DInfo); + return handleDecl(D, Loc, getCursor(D), DInfo); } bool CXIndexDataConsumer::handleSynthesizedObjCProperty( |