Commit Graph

9 Commits

Author SHA1 Message Date
Ilya Biryukov 4ae2381430 [clangd] Fix template type aliases in findExplicitReference
Reviewers: kadircet

Reviewed By: kadircet

Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68124

llvm-svn: 373104
2019-09-27 17:55:46 +00:00
Ilya Biryukov c383509ce6 [clangd] Handle type template parameters in findExplicitReferences
Reviewers: kadircet

Reviewed By: kadircet

Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68120

llvm-svn: 373067
2019-09-27 10:55:53 +00:00
Ilya Biryukov 2774457b2a [clangd] Support OverloadExpr in findExplicitReferences
Reviewers: kadircet

Reviewed By: kadircet

Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68118

llvm-svn: 373057
2019-09-27 09:39:10 +00:00
Kadir Cetinkaya 007e4fe901 [clangd] Change constness of parameters to findExplicitRefs
Summary:
Recursive AST requires non-const ast nodes, but it doesn't really
mutate them. In addition to that, in clangd we mostly have const ast nodes. So
it makes sense to move the const_cast into callee rather than having it at every
caller in the future.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68027

llvm-svn: 372888
2019-09-25 15:44:26 +00:00
Ilya Biryukov f96d2e1754 [clangd] A helper to find explicit references and their names
Summary:
Allows to simplify pending code tweaks:
  - the upcoming DefineInline tweak (D66647)
  - remove using declaration (D56612)
  - qualify name under cursor (D56610)

Another potential future application is simplifying semantic highlighting.

Reviewers: kadircet

Reviewed By: kadircet

Subscribers: mgrang, jfb, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67826

llvm-svn: 372859
2019-09-25 12:40:22 +00:00
Michael Liao de52403843 [clangd] Remove redundant semi-colon.
llvm-svn: 370763
2019-09-03 15:02:46 +00:00
Sam McCall 80195e7d1c [clangd] Wrong attribute on debug function in r370746
llvm-svn: 370757
2019-09-03 13:54:27 +00:00
Simon Pilgrim 54b989cf98 Fix MSVC "not all control paths return a value" warning. NFCI.
llvm-svn: 370750
2019-09-03 13:05:13 +00:00
Sam McCall 489cc589c5 [clangd] Add targetDecl(), which determines what declaration an AST node refers to.
Summary:
This is the first part of an effort to "unbundle" our libIndex use into separate
concerns (AST traversal, token<->node mapping, node<->decl mapping,
decl<->decl relationshipes).

Currently, clangd relies on libIndex to associate tokens, AST nodes, and decls.
This leads to rather convoluted implementations of e.g. hover and
extract-function, which are not naturally thought of as indexing applications.

The idea is that by decoupling different concerns, we make them easier
to use, test, and combine, and more efficient when only one part is needed.
There are some synergies between e.g. traversal and finding
relationships between decls, hopefully the benefits outweight these.

Reviewers: kadircet, ilya-biryukov

Subscribers: mgorny, MaskRay, jkorous, arphaman, jfb, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D66751

llvm-svn: 370746
2019-09-03 11:35:50 +00:00