[clang] use getCommonSugar in an assortment of places
authorMatheus Izvekov <mizvekov@gmail.com>
Sun, 10 Oct 2021 13:28:37 +0000 (15:28 +0200)
committerMatheus Izvekov <mizvekov@gmail.com>
Fri, 16 Sep 2022 09:55:40 +0000 (11:55 +0200)
commitaff1f6310e5f4cea92c4504853d5fd824754a74f
tree576ac666831d84f1ed86a0566ca8e81ef3c847db
parentb4309800e9dc53a84222a6b57c8615d4a3084988
[clang] use getCommonSugar in an assortment of places

For this patch, a simple search was performed for patterns where there are
two types (usually an LHS and an RHS) which are structurally the same, and there
is some result type which is resolved as either one of them (typically LHS for
consistency).

We change those cases to resolve as the common sugared type between those two,
utilizing the new infrastructure created for this purpose.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D111509
23 files changed:
clang-tools-extra/clangd/unittests/tweaks/ExtractVariableTests.cpp
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines/narrowing-conversions-ignoreconversionfromtypes-option.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/test/AST/ast-dump-fpfeatures.cpp
clang/test/CodeGen/compound-assign-overflow.c
clang/test/Sema/complex-int.c
clang/test/Sema/matrix-type-operators.c
clang/test/Sema/nullability.c
clang/test/Sema/sugar-common-types.c [new file with mode: 0644]
clang/test/SemaCXX/complex-conversion.cpp
clang/test/SemaCXX/matrix-type-operators.cpp
clang/test/SemaCXX/sugar-common-types.cpp [new file with mode: 0644]
clang/test/SemaCXX/sugared-auto.cpp
clang/test/SemaObjC/format-strings-objc.m
compiler-rt/test/ubsan/TestCases/Integer/add-overflow.cpp
compiler-rt/test/ubsan/TestCases/Integer/no-recover.cpp
compiler-rt/test/ubsan/TestCases/Integer/sub-overflow.cpp
compiler-rt/test/ubsan/TestCases/Integer/uadd-overflow.cpp
compiler-rt/test/ubsan/TestCases/Integer/umul-overflow.cpp
compiler-rt/test/ubsan/TestCases/Integer/usub-overflow.cpp
lldb/test/API/commands/expression/rdar42038760/main.c
lldb/test/API/commands/expression/rdar44436068/main.c