[all-commits] [llvm/llvm-project] 2b833d: [AST] Improve traversal of concepts and concept re...

Ilya Biryukov via All-commits all-commits at lists.llvm.org
Thu Apr 28 02:38:07 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b833d4086aba3c0fca480549309af54bfdd8e2e
      https://github.com/llvm/llvm-project/commit/2b833d4086aba3c0fca480549309af54bfdd8e2e
  Author: Ilya Biryukov <ibiryukov at google.com>
  Date:   2022-04-28 (Thu, 28 Apr 2022)

  Changed paths:
    M clang-tools-extra/clangd/Selection.cpp
    M clang-tools-extra/clangd/unittests/XRefsTests.cpp
    M clang/include/clang/AST/RecursiveASTVisitor.h
    M clang/lib/Index/IndexBody.cpp
    M clang/unittests/Tooling/RecursiveASTVisitorTests/Concept.cpp

  Log Message:
  -----------
  [AST] Improve traversal of concepts and concept requirements

- Do not traverse concept decl inside `AutoType`. We only traverse
  declaration and definitions, not references to a declaration.
- Do not visit implicit AST node the relevant traversal mode.
- Add traversal extension points for concept requirements.
- Renamed `TraverseConceptReference` to mark as helper to share
  the code. Having an extension point there seems confusing given that
  there are many concept refences in the AST that do not call the
  helper. Those are `AutoType`, `AutoTypeLoc` and constraint requirements.

Only clangd code requires an update.

There are no use-cases for concept requirement traversals yet, but
I added them in the earlier version of the patch and decided to keep
them for completeness.

Reviewed By: sammccall

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




More information about the All-commits mailing list