From: Alex Lorenz Date: Thu, 9 Nov 2017 20:50:59 +0000 (+0000) Subject: [index] tag declarations should use the decl role instead of ref X-Git-Tag: llvmorg-6.0.0-rc1~3752 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41856684c143d96631ca60614830e8b9a075f8e4;p=platform%2Fupstream%2Fllvm.git [index] tag declarations should use the decl role instead of ref The 'decl' role is more canonical than the 'ref'. This helps us establish the 'specialization-of' relation just by looking at decls or defs. rdar://31884960 llvm-svn: 317832 --- diff --git a/clang/lib/Index/IndexDecl.cpp b/clang/lib/Index/IndexDecl.cpp index 2704e6d..0615aea 100644 --- a/clang/lib/Index/IndexDecl.cpp +++ b/clang/lib/Index/IndexDecl.cpp @@ -354,12 +354,10 @@ public: gatherTemplatePseudoOverrides(D, Relations); IndexCtx.indexTagDecl(D, Relations); } else { - auto *Parent = dyn_cast(D->getDeclContext()); SmallVector Relations; gatherTemplatePseudoOverrides(D, Relations); - return IndexCtx.handleReference(D, D->getLocation(), Parent, - D->getLexicalDeclContext(), - SymbolRoleSet(), Relations); + return IndexCtx.handleDecl(D, D->getLocation(), SymbolRoleSet(), + Relations, D->getLexicalDeclContext()); } } return true; diff --git a/clang/test/Index/Core/index-source.cpp b/clang/test/Index/Core/index-source.cpp index 6ad600b..6f485fe 100644 --- a/clang/test/Index/Core/index-source.cpp +++ b/clang/test/Index/Core/index-source.cpp @@ -201,8 +201,8 @@ class PseudoOverridesInSpecializations { template class InnerClass; -// CHECK: [[@LINE-1]]:9 | class(Gen)/C++ | InnerClass | c:@S@PseudoOverridesInSpecializations>#d#I@ST>1#T@InnerClass | | Ref,RelCont,RelSpecialization | rel: 2 -// CHECK-NEXT: RelCont +// CHECK: [[@LINE-1]]:9 | class(Gen)/C++ | InnerClass | c:@S@PseudoOverridesInSpecializations>#d#I@ST>1#T@InnerClass | | Decl,RelChild,RelSpecialization | rel: 2 +// CHECK-NEXT: RelChild // CHECK-NEXT: RelSpecialization | InnerClass | c:@ST>2#T#T@PseudoOverridesInSpecializations@ST>1#T@InnerClass }; @@ -274,7 +274,7 @@ void ContainsSpecializedMemberFunction::memberSpecialization() { template class SpecializationDecl; -// CHECK: [[@LINE-1]]:7 | class(Gen)/C++ | SpecializationDecl | c:@ST>1#T@SpecializationDecl | | Ref | rel: 0 +// CHECK: [[@LINE-1]]:7 | class(Gen)/C++ | SpecializationDecl | c:@ST>1#T@SpecializationDecl | | Decl | rel: 0 template class SpecializationDecl { };