[all-commits] [llvm/llvm-project] 5a5be4: [AST] Add a new TemplateKind for template decls fo...

Haojian Wu via All-commits all-commits at lists.llvm.org
Tue Apr 12 01:48:42 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5a5be4044f0bceb71bb6a81f6955704691b389ed
      https://github.com/llvm/llvm-project/commit/5a5be4044f0bceb71bb6a81f6955704691b389ed
  Author: Haojian Wu <hokein.wu at gmail.com>
  Date:   2022-04-12 (Tue, 12 Apr 2022)

  Changed paths:
    M clang-tools-extra/clangd/DumpAST.cpp
    M clang-tools-extra/clangd/SemanticHighlighting.cpp
    M clang/include/clang/AST/PropertiesBase.td
    M clang/include/clang/AST/TemplateName.h
    M clang/include/clang/AST/TextNodeDumper.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/lib/AST/ItaniumMangle.cpp
    M clang/lib/AST/ODRHash.cpp
    M clang/lib/AST/TemplateName.cpp
    M clang/lib/AST/TextNodeDumper.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaDeclCXX.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    A clang/test/AST/ast-dump-using-template.cpp
    M clang/test/CXX/temp/temp.deduct.guide/p3.cpp
    M clang/tools/libclang/CIndex.cpp
    M clang/unittests/AST/ASTImporterTest.cpp
    M clang/unittests/AST/CMakeLists.txt
    A clang/unittests/AST/TemplateNameTest.cpp

  Log Message:
  -----------
  [AST] Add a new TemplateKind for template decls found via a using decl.

This is the template version of https://reviews.llvm.org/D114251.

This patch introduces a new template name kind (UsingTemplateName). The
UsingTemplateName stores the found using-shadow decl (and underlying
template can be retrieved from the using-shadow decl). With the new
template name, we can be able to find the using decl that a template
typeloc (e.g. TemplateSpecializationTypeLoc) found its underlying template,
which is useful for tooling use cases (include cleaner etc).

This patch merely focuses on adding the node to the AST.

Next steps:
- support using-decl in qualified template name;
- update the clangd and other tools to use this new node;
- add ast matchers for matching different kinds of template names;

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




More information about the All-commits mailing list