Summary:
In current indexing logic we get references to class itself when we see
a constructor/destructor which is only syntactically true. Semantically
this information is not correct. This patch marks that reference as
NameReference to let clients deal with it.
Reviewers: akyrtzi, gribozavr, nathawes, benlangmuir
Reviewed By: gribozavr, nathawes
Subscribers: nathawes, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58814
llvm-svn: 355668
Summary:
Indexing context was skipping explicit template instantiations as well.
This patch makes sure it only skips implicit ones.
Subscribers: arphaman, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58189
llvm-svn: 354262
Summary:
This makes BindingDecl's of the same name have different USRs, so that references can be correctly attributed.
int a[1] = {};
{ auto [x] = a; x; }
{ auto [x] = a; x; }
Reviewers: akyrtzi, arphaman, rsmith, hokein
Reviewed By: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D52445
llvm-svn: 344010
* Create a USR for the occurrences of the 'module' symbol kind
* Record module references for each identifier in an import declaration
llvm-svn: 342484
TemplateTemplateParmDecls of alias templates ended-up serialized as 'file-level decls' which was causing a crash while trying to index a PCH/module file that contained them.
Commit makes sure TemplateTemplateParmDecls are not recorded as such kind of decls.
Fixes crash of rdar://36608297
Differential Revision: https://reviews.llvm.org/D42588
llvm-svn: 323549
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
In dependent contexts we end up referencing these, so make sure they
have USRs, and have their declarations indexed. For the most part they
behave like typedefs, but we also need to worry about having multiple
using declarations with the same "name".
rdar://problem/33883650
llvm-svn: 311053
CXXDeductionGuideDecls can't be referenced so there's no need to output a symbol occurrence for them.
Also handle DeducedTemplateSpecializationTypeLocs in the TypeIndexer so we don't miss the symbol occurrences of the corresponding template decls.
Patch by Nathan Hawes!
Differential Revision: https://reviews.llvm.org/D36641
llvm-svn: 310933
We have the same relation between class properties and getter/setters
that we have for instance properties, so set the same symbol sub-kind.
rdar://problem/32376404
llvm-svn: 308800
Summary:
This patch prevents getCanonicalDecl returning nullptr in case it finds
a canonical TemplateDeclaration with no attached TemplatedDecl.
Found by running the indexer over a version of the standard library deep inside
a template metaprogramming mess.
Reviewers: klimek, vsk
Reviewed By: vsk
Subscribers: vsk, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D35212
llvm-svn: 308269
Unless it's one of the special cases (tag, category) that we can handle.
This syncs up the check between handling a decl and handling a relation.
This would cause invalid nameless decls to end up in relations despite
having no name or USR.
rdar://problem/32474406
llvm-svn: 307855
of class template specializations
This commit fixes an issue where a forward declaration of a class template
specialization was not related to the base template. We need to relate even
forward declarations because specializations don't have to be defined.
rdar://32869409
Differential Revision: https://reviews.llvm.org/D34462
llvm-svn: 305996
"specializationOf" relation if they pseudo-override a type in the base template
This commit fixes an issue where Xcode's renaming engine couldn't find the
reference to the second occurrence of "InnerClass" in this example:
template<typename T> struct Ts { template<typename U> struct InnerClass { }; };
template<> struct Ts<int> {
template<typename U> struct InnerClass; // This occurrence wasn't renamed
};
rdar://31884960
Differential Revision: https://reviews.llvm.org/D34392
llvm-svn: 305911
static_assert declarations have to be visited while indexing so that we can
gather the references to declarations that are present in their assert
expression.
Differential Revision: https://reviews.llvm.org/D33913
llvm-svn: 305504
looking up a dependent name in a record that derives from itself
rdar://32273000
Differential Revision: https://reviews.llvm.org/D33324
llvm-svn: 303366
This commit implements basic support for indexing of dependent declaration
references. Now the indexer tries to find a suitable match in the base template
for a dependent member ref/decl ref/dependent type.
rdar://29158210
Differential Revision: https://reviews.llvm.org/D32972
llvm-svn: 302632
specializations that 'override' declarations in the base template should use
the 'specializationOf' relation instead of 'specializationOf | overrideOf'.
The indexer relations are meant to be orthogonal, so 'specializationOf' is
better than the combined relation.
llvm-svn: 302136
that 'override' declarations in the base template should be recorded
This can be used for improved "go to definition" feature in Xcode.
rdar://31604739
Differential Revision: https://reviews.llvm.org/D32020
llvm-svn: 301180