[PATCH] D124441: [Index] [clangd] Support for concept declarations and requires expressions

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 02:12:52 PDT 2022


ilya-biryukov created this revision.
ilya-biryukov added a reviewer: sammccall.
Herald added subscribers: usaxena95, kadircet, arphaman.
Herald added a project: All.
ilya-biryukov requested review of this revision.
Herald added a subscriber: MaskRay.
Herald added projects: clang, clang-tools-extra.

Add support for concepts and requires expression in the clang index.
Genarate USRs for concepts.

Also how `RecursiveASTVisitor` handles return type requirement in
requires expressions. The new code unpacks the synthetic template parameter
list used for storing the actual expression. This simplifies
implementation of the indexing. No code seems to depend on the original
traversal anyway and the synthesized template parameter list is easily
accessible from inside the requires expression if needed.

Add tests in the clangd codebase.

Fixes https://github.com/clangd/clangd/issues/1103.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124441

Files:
  clang-tools-extra/clangd/CodeComplete.cpp
  clang-tools-extra/clangd/Protocol.cpp
  clang-tools-extra/clangd/Quality.cpp
  clang-tools-extra/clangd/index/SymbolCollector.cpp
  clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
  clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp
  clang-tools-extra/clangd/unittests/TestIndex.cpp
  clang-tools-extra/clangd/unittests/TestIndex.h
  clang-tools-extra/clangd/unittests/XRefsTests.cpp
  clang/include/clang/AST/RecursiveASTVisitor.h
  clang/include/clang/Index/IndexSymbol.h
  clang/lib/Index/IndexBody.cpp
  clang/lib/Index/IndexDecl.cpp
  clang/lib/Index/IndexSymbol.cpp
  clang/lib/Index/IndexTypeSourceInfo.cpp
  clang/lib/Index/IndexingContext.cpp
  clang/lib/Index/USRGeneration.cpp
  clang/tools/libclang/CXIndexDataConsumer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124441.425156.patch
Type: text/x-patch
Size: 17994 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220426/b893ac38/attachment-0001.bin>


More information about the cfe-commits mailing list