[all-commits] [llvm/llvm-project] 761787: Reland: [clang] Improved canonicalization for temp...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Sat Apr 12 10:26:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 761787d42576751afbaaba5107233ee849f81b6f
      https://github.com/llvm/llvm-project/commit/761787d42576751afbaaba5107233ee849f81b6f
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-04-12 (Sat, 12 Apr 2025)

  Changed paths:
    M clang-tools-extra/clangd/AST.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/PropertiesBase.td
    M clang/include/clang/AST/TemplateBase.h
    M clang/include/clang/AST/Type.h
    M clang/include/clang/AST/TypeProperties.td
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTDiagnostic.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/ASTStructuralEquivalence.cpp
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/AST/QualTypeNames.cpp
    M clang/lib/AST/TemplateBase.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Sema/SemaCXXScopeSpec.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaLookup.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
    M clang/lib/Sema/SemaTemplateVariadic.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/test/CXX/class.derived/class.derived.general/p2.cpp
    M clang/test/CXX/temp/temp.decls/temp.class.spec/p6.cpp
    M clang/test/SemaCXX/undefined-partial-specialization.cpp
    M clang/test/SemaTemplate/make_integer_seq.cpp
    M clang/test/SemaTemplate/type_pack_element.cpp
    M clang/unittests/AST/TypePrinterTest.cpp

  Log Message:
  -----------
  Reland: [clang] Improved canonicalization for template specialization types (#135414)

This relands https://github.com/llvm/llvm-project/pull/135119, after
fixing crashes seen in LLDB CI reported here:
https://github.com/llvm/llvm-project/pull/135119#issuecomment-2794910840

Fixes https://github.com/llvm/llvm-project/pull/135119

This changes the TemplateArgument representation to hold a flag
indicating whether a tempalte argument of expression type is supposed to
be canonical or not.

This gets one step closer to solving
https://github.com/llvm/llvm-project/issues/92292

This still doesn't try to unique as-written TSTs. While this would
increase the amount of memory savings and make code dealing with the AST
more well-behaved, profiling template argument lists is still too
expensive for this to be worthwhile, at least for now.

This also fixes the context creation of TSTs, so that they don't in some
cases get incorrectly flagged as sugar over their own canonical form.
This is captured in the test expectation change of some AST dumps.

This fixes some places which were unnecessarily canonicalizing these
TSTs.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list