[all-commits] [llvm/llvm-project] 4739a9: [Clang][NFC] Remove TemplateArgumentList::OnStack ...

Krystian Stasiowski via All-commits all-commits at lists.llvm.org
Thu Feb 1 08:51:02 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4739a97faedf766541245e6a5b48595d4a3deaae
      https://github.com/llvm/llvm-project/commit/4739a97faedf766541245e6a5b48595d4a3deaae
  Author: Krystian Stasiowski <sdkrystian at gmail.com>
  Date:   2024-02-01 (Thu, 01 Feb 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/DeclTemplate.h
    M clang/include/clang/Sema/Sema.h
    M clang/lib/AST/DeclTemplate.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

  Log Message:
  -----------
  [Clang][NFC] Remove TemplateArgumentList::OnStack (#79760)

This patch removes on-stack `TemplateArgumentList`'s. They were primary used
to pass an `ArrayRef<TemplateArgument>` to
`Sema::getTemplateInstantiationArgs`, which had a `const
TemplateArgumentList*` parameter for the innermost template argument
list. Changing this parameter to an
`std::optional<ArrayRef<TemplateArgument>>` eliminates the need for
on-stack `TemplateArgumentList`'s, which in turn eliminates the need for
`TemplateArgumentList` to store a pointer to its template argument
storage (which is redundant in almost all cases, as it is an AST
allocated type).




More information about the All-commits mailing list