[all-commits] [llvm/llvm-project] 326fea: [clang] Implement sugared substitution changes to ...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Wed Oct 26 21:19:18 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 326feaafb0913ec6b21d1d89d09cbdbb40db7503
      https://github.com/llvm/llvm-project/commit/326feaafb0913ec6b21d1d89d09cbdbb40db7503
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2022-10-27 (Thu, 27 Oct 2022)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/PropertiesBase.td
    M clang/include/clang/AST/TemplateName.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/AST/TypeProperties.td
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Sema/Template.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/TemplateName.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/lib/Sema/SemaType.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Sema/TypeLocBuilder.cpp
    M clang/lib/Sema/TypeLocBuilder.h
    M clang/test/SemaTemplate/nested-name-spec-template.cpp

  Log Message:
  -----------
  [clang] Implement sugared substitution changes to infrastructure

Implements the changes required to perform substitution with
non-canonical template arguments, and to 'finalize' them
by not placing 'Subst' nodes.

A finalized substitution means we won't resugar them later,
because these templates themselves were eagerly substituted
with the intended arguments at the point of use. We may still
resugar other templates used within those, though.

This patch does not actually implement any uses of this
functionality, those will be added in subsequent patches,
so expect no changes to existing tests.

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

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


  Commit: d4b1964f0554046b1e64908e5c1cd701b25f4c9e
      https://github.com/llvm/llvm-project/commit/d4b1964f0554046b1e64908e5c1cd701b25f4c9e
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2022-10-27 (Thu, 27 Oct 2022)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/test/AST/ast-dump-template-decls.cpp
    M clang/test/CXX/drs/dr3xx.cpp
    M clang/test/CXX/expr/expr.const/p3-0x.cpp
    M clang/test/Misc/diag-template-diffing.cpp
    M clang/test/SemaTemplate/instantiation-default-1.cpp
    M clang/test/SemaTemplate/make_integer_seq.cpp

  Log Message:
  -----------
  [clang] Instantiate NTTPs and template default arguments with sugar

This makes use of the changes introduced in D134604, in order to
instantiate non-type template parameters and default template arguments
with a final sugared substitution.

This comes at no additional relevant cost.
Since we don't track / unique them in specializations, we wouldn't be
able to resugar them later anyway.

Signed-off-by: Matheus Izvekov <mizvekov at gmail.com>

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


Compare: https://github.com/llvm/llvm-project/compare/d6a0585dd1b8...d4b1964f0554


More information about the All-commits mailing list