[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>
Thu, 8 Sep 2022 17:17:53 +0000 (19:17 +0200)
commitd42122cd5db021e6b14a90a98ad1dd09412efb4c
tree5ec2a1d9a623fb9b42d366a8e05ed0c86c56a084
parentd200db38637884fd0b421802c6094b2a03ceb29e
[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.

Depends on D111283

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D111509
21 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/matrix-type-operators.c
clang/test/Sema/nullability.c
clang/test/Sema/sugar-common-types.c [new file with mode: 0644]
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