[all-commits] [llvm/llvm-project] 00ce27: [clang] extend getCommonSugaredType to merge sugar...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Fri Sep 16 08:05:32 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 00ce271712d407b5347681c36474b80cfb0033d3
      https://github.com/llvm/llvm-project/commit/00ce271712d407b5347681c36474b80cfb0033d3
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2022-09-16 (Fri, 16 Sep 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTContext.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/test/SemaCXX/sugar-common-types.cpp
    M clang/test/SemaTemplate/deduction.cpp

  Log Message:
  -----------
  [clang] extend getCommonSugaredType to merge sugar nodes

This continues D111283 by extending the getCommonSugaredType
implementation to also merge non-canonical type nodes.

We merge these nodes by going up starting from the canonical
node, calculating their merged properties on the way.

If we reach a pair that is too different, or which we could not
otherwise unify, we bail out and don't try to keep going on to
the next pair, in effect striping out all the remaining top-level
sugar nodes. This avoids mismatching 'companion' nodes, such as
ElaboratedType, so that they don't end up elaborating some other
unrelated thing.

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

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




More information about the All-commits mailing list