Skip to content

Commit 0448f0f

Browse files
authored
Merge branch 'llvm:main' into main
2 parents 63d1af5 + 90de4a4 commit 0448f0f

File tree

704 files changed

+17607
-14356
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

704 files changed

+17607
-14356
lines changed

.git-blame-ignore-revs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,40 @@ d33bf2e9df578ff7e44fd22504d6ad5a122b7ee6
106106
ce46adb8b7ce645353eccaedf31ed9765dab77bb
107107
68070f908bb7ac5f0b5fa9722caa504ecf723f6b
108108
5213c57cb1f0d78aad9a253b7f6a2b62ff4c7859
109+
110+
# [mlir] Update create method
111+
9e7834cadf48292b5d127d6d98f9e6d565ed5d9a
112+
284a5c2c0b97edddf255ea210f939203ad3d09f2
113+
c090ed53fb73f59cf221f5610430af8047758117
114+
fcbcfe44cff00101a6a98a73971398eb8dd87710
115+
258daf539583b80e0217d1d87941412d65cf16aa
116+
c610b244937ed847b0275ccb038c0f2d36310b4a
117+
b58ad3650f2195117f484d551ffbada27e7d1e14
118+
258d04c810ab10f101324cbf1fe3c7be65eb1938
119+
a6bf40d1c6cf010b3ad90bf7f410983453f4deb2
120+
dcfc853c51aecf6538182378c016f8e1604e7e97
121+
3f74334c38120bbdefac012d478dfce8e4eb0906
122+
a636b7bfdd1d8304b78e8b42ec900a21736d4afb
123+
75aa7065dcf653de7870758cd502a7c714f4bcd7
124+
2f5312563fd5cb2e355ec49109f3e63875337c7c
125+
967626b842551ecd997c0d10eb68c3015b63a3d7
126+
588845defd09359a8b87db339b563af848cf45a7
127+
b0434925c98c9a8906afea60a1304c870b1f574a
128+
8fff238b2c363b036ce9e7bf7abab3acafc87ab2
129+
38976a03cd367b27437e0d1e81c0ccaee2777b47
130+
eaa67a3cf041009ae33a45159d0465262c3af5dc
131+
b0312be6aa664e4cb9abec6d080e971493093d05
132+
2736fbd8324bf21a130c8abd4bd0e7d3aa840ac1
133+
4ae9fdca8af095afd91705f8dd143e93b304b6fb
134+
f904cdd6c3049e605d24ed17680e80e7133908a0
135+
972ac59c9af4ad47af0b3542ae936b3470727e5f
136+
7b787965431e666858fdf66db25ee5a129833927
137+
c3823af156b517d926a56e3d0d585e2a15720e96
138+
dce6679cf5cbbdaffb9c2b51dc762c5c6689ea78
139+
9844ba6d9740206129b52633c555f767eaa45581
140+
5547c6cd03ddddd405a09e51624e1f19955a85b1
141+
a3a007ad5fa20abc90ead4e1030b481bf109b4cf
142+
46f6df0848ea04449c6179ecdedc404ee5b5cf11
143+
b7e332d3f59f567b1999fbcc660d7837cba8e406
144+
6056f942abe83b05406df8b04e95ec37a3d160b5
145+
906295b8a31c8dac5aa845864c0bca9f02f86184

bolt/test/X86/debug-fission-single-convert.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@
1414
# RUN: -nostartfiles \
1515
# RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \
1616
# RUN: %t.o -o %t.exe
17+
# RUN: mkdir -p %t.dwarf-output
1718
# RUN: llvm-bolt %t.exe \
1819
# RUN: --reorder-blocks=reverse \
1920
# RUN: --update-debug-sections \
20-
# RUN: --dwarf-output-path=%T \
21+
# RUN: --dwarf-output-path=%t.dwarf-output \
2122
# RUN: --always-convert-to-ranges=true \
2223
# RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s
2324
# RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest
24-
# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest
25+
# RUN: not llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple-convert.dwo0.dwo >> %tAddrIndexTest
2526
# RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO
2627
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC
2728

bolt/test/X86/debug-fission-single.s

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@
1414
# RUN: -nostartfiles \
1515
# RUN: -Wl,--script=%p/Inputs/debug-fission-script.txt \
1616
# RUN: %t.o -o %t.exe
17+
# RUN: mkdir -p %t.dwarf-output
1718
# RUN: llvm-bolt %t.exe \
1819
# RUN: --reorder-blocks=reverse \
1920
# RUN: --update-debug-sections \
20-
# RUN: --dwarf-output-path=%T \
21+
# RUN: --dwarf-output-path=%t.dwarf-output \
2122
# RUN: -o %t.bolt.1.exe 2>&1 | FileCheck %s
2223
# RUN: llvm-dwarfdump --show-form --verbose --debug-ranges %t.bolt.1.exe &> %tAddrIndexTest
23-
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %T/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest
24+
# RUN: llvm-dwarfdump --show-form --verbose --debug-info %t.dwarf-output/debug-fission-simple.dwo0.dwo >> %tAddrIndexTest
2425
# RUN: cat %tAddrIndexTest | FileCheck %s --check-prefix=CHECK-DWO-DWO
2526
# RUN: llvm-dwarfdump --show-form --verbose --debug-addr %t.bolt.1.exe | FileCheck %s --check-prefix=CHECK-ADDR-SEC
2627

bolt/test/X86/inlined-function-mixed.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
## Make sure inlining from a unit with debug info into unit without
22
## debug info does not cause a crash.
33

4-
RUN: %clangxx %cxxflags %S/Inputs/inlined.cpp -c -o %T/inlined.o
5-
RUN: %clangxx %cxxflags %S/Inputs/inlinee.cpp -c -o %T/inlinee.o -g
6-
RUN: %clangxx %cxxflags %T/inlined.o %T/inlinee.o -o %t
4+
RUN: %clangxx %cxxflags %S/Inputs/inlined.cpp -c -o %t.inlined.o
5+
RUN: %clangxx %cxxflags %S/Inputs/inlinee.cpp -c -o %t.inlinee.o -g
6+
RUN: %clangxx %cxxflags %t.inlined.o %t.inlinee.o -o %t
77

88
RUN: llvm-bolt %t -o %t.bolt --update-debug-sections --reorder-blocks=reverse \
99
RUN: --inline-small-functions --force-inline=main | FileCheck %s

clang-tools-extra/clang-tidy/llvm/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ add_clang_library(clangTidyLLVMModule STATIC
1717
clangTidy
1818
clangTidyReadabilityModule
1919
clangTidyUtils
20-
clangTransformer
2120

2221
DEPENDS
2322
omp_gen
@@ -31,4 +30,5 @@ clang_target_link_libraries(clangTidyLLVMModule
3130
clangBasic
3231
clangLex
3332
clangTooling
33+
clangTransformer
3434
)

clang-tools-extra/clang-tidy/modernize/UseDesignatedInitializersCheck.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,11 @@ void UseDesignatedInitializersCheck::registerMatchers(MatchFinder *Finder) {
121121
hasAnyBase(hasType(cxxRecordDecl(has(fieldDecl()))));
122122
Finder->addMatcher(
123123
initListExpr(
124-
hasType(cxxRecordDecl(
125-
RestrictToPODTypes ? isPOD() : isAggregate(),
126-
unless(anyOf(HasBaseWithFields, hasName("::std::array"))))
127-
.bind("type")),
124+
hasType(hasUnqualifiedDesugaredType(recordType(hasDeclaration(
125+
cxxRecordDecl(
126+
RestrictToPODTypes ? isPOD() : isAggregate(),
127+
unless(anyOf(HasBaseWithFields, hasName("::std::array"))))
128+
.bind("type"))))),
128129
IgnoreSingleElementAggregates ? hasMoreThanOneElement() : anything(),
129130
unless(isFullyDesignated()))
130131
.bind("init"),
@@ -155,7 +156,7 @@ void UseDesignatedInitializersCheck::check(
155156
DiagnosticBuilder Diag =
156157
diag(InitList->getLBraceLoc(),
157158
"use designated initializer list to initialize %0");
158-
Diag << Type << InitList->getSourceRange();
159+
Diag << InitList->getType() << InitList->getSourceRange();
159160
for (const Stmt *InitExpr : *SyntacticInitList) {
160161
const auto Designator = Designators[InitExpr->getBeginLoc()];
161162
if (Designator && !Designator->empty())

clang-tools-extra/clang-tidy/modernize/UseUsingCheck.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
9292
const LangOptions &LO = getLangOpts();
9393

9494
// Match CXXRecordDecl only to store the range of the last non-implicit full
95-
// declaration, to later check whether it's within the typdef itself.
95+
// declaration, to later check whether it's within the typedef itself.
9696
const auto *MatchedTagDecl = Result.Nodes.getNodeAs<TagDecl>(TagDeclName);
9797
if (MatchedTagDecl) {
9898
// It is not sufficient to just track the last TagDecl that we've seen,
@@ -152,7 +152,7 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
152152
StringRef ExtraReference = "";
153153
if (MainTypeEndLoc.isValid() && TypeRange.fullyContains(MainTypeEndLoc)) {
154154
// Each type introduced in a typedef can specify being a reference or
155-
// pointer type seperately, so we need to sigure out if the new using-decl
155+
// pointer type separately, so we need to figure out if the new using-decl
156156
// needs to be to a reference or pointer as well.
157157
const SourceLocation Tok = utils::lexer::findPreviousAnyTokenKind(
158158
MatchedDecl->getLocation(), SM, LO, tok::TokenKind::star,

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ Changes in existing checks
128128
- Improved :doc:`misc-header-include-cycle
129129
<clang-tidy/checks/misc/header-include-cycle>` check performance.
130130

131+
- Improved :doc:`modernize-use-designated-initializers
132+
<clang-tidy/checks/modernize/use-designated-initializers>` check to
133+
suggest using designated initializers for aliased aggregate types.
134+
131135
- Improved :doc:`modernize-use-std-format
132136
<clang-tidy/checks/modernize/use-std-format>` check to correctly match
133137
when the format string is converted to a different type by an implicit

clang-tools-extra/test/clang-tidy/checkers/modernize/use-designated-initializers.cpp

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,55 @@ std::array a{1,2,3};
224224
std::array<int,2> b{10, 11};
225225
using array = std::array<int, 2>;
226226
array c{10, 11};
227+
228+
struct S16 {
229+
int a;
230+
int b;
231+
};
232+
233+
using S17 = S16;
234+
235+
S17 s171{1, 2};
236+
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use designated initializer list to initialize 'S17' (aka 'S16') [modernize-use-designated-initializers]
237+
// CHECK-MESSAGES: :[[@LINE-9]]:1: note: aggregate type is defined here
238+
// CHECK-FIXES: S17 s171{.a=1, .b=2};
239+
// CHECK-MESSAGES-POD: :[[@LINE-4]]:9: warning: use designated initializer list to initialize 'S17' (aka 'S16') [modernize-use-designated-initializers]
240+
// CHECK-MESSAGES-POD: :[[@LINE-12]]:1: note: aggregate type is defined here
241+
// CHECK-FIXES-POD: S17 s171{.a=1, .b=2};
242+
243+
S17 s172{.a=1, 2};
244+
// CHECK-MESSAGES: :[[@LINE-1]]:16: warning: use designated init expression to initialize field 'b' [modernize-use-designated-initializers]
245+
// CHECK-MESSAGES-POD: :[[@LINE-2]]:16: warning: use designated init expression to initialize field 'b' [modernize-use-designated-initializers]
246+
// CHECK-FIXES: S17 s172{.a=1, .b=2};
247+
248+
S17 s173{.a=1, .b=2}; // no issue
249+
250+
typedef S16 S18;
251+
252+
S18 s181{1, 2};
253+
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use designated initializer list to initialize 'S18' (aka 'S16') [modernize-use-designated-initializers]
254+
// CHECK-MESSAGES-POD: :[[@LINE-2]]:9: warning: use designated initializer list to initialize 'S18' (aka 'S16') [modernize-use-designated-initializers]
255+
256+
S18 s182{1, .b=2};
257+
// CHECK-MESSAGES: :[[@LINE-1]]:10: warning: use designated init expression to initialize field 'a' [modernize-use-designated-initializers]
258+
// CHECK-MESSAGES-POD: :[[@LINE-2]]:10: warning: use designated init expression to initialize field 'a' [modernize-use-designated-initializers]
259+
// CHECK-FIXES: S18 s182{.a=1, .b=2};
260+
261+
S18 s183{.a=1, .b=2}; // no issue
262+
263+
struct S19 {
264+
int i;
265+
S17 s17;
266+
S18 s18;
267+
};
268+
269+
S19 s191{1, {2, .b=3}, {4, 5}};
270+
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: use designated initializer list to initialize 'S19' [modernize-use-designated-initializers]
271+
// CHECK-MESSAGES: :[[@LINE-8]]:1: note: aggregate type is defined here
272+
// CHECK-MESSAGES: :[[@LINE-3]]:14: warning: use designated init expression to initialize field 'a' [modernize-use-designated-initializers]
273+
// CHECK-MESSAGES: :[[@LINE-4]]:24: warning: use designated initializer list to initialize 'S18' (aka 'S16') [modernize-use-designated-initializers]
274+
// CHECK-MESSAGES-POD: :[[@LINE-5]]:9: warning: use designated initializer list to initialize 'S19' [modernize-use-designated-initializers]
275+
// CHECK-MESSAGES-POD: :[[@LINE-12]]:1: note: aggregate type is defined here
276+
// CHECK-MESSAGES-POD: :[[@LINE-7]]:14: warning: use designated init expression to initialize field 'a' [modernize-use-designated-initializers]
277+
// CHECK-MESSAGES-POD: :[[@LINE-8]]:24: warning: use designated initializer list to initialize 'S18' (aka 'S16') [modernize-use-designated-initializers]
278+
// CHECK-FIXES: S19 s191{.i=1, .s17={.a=2, .b=3}, .s18={.a=4, .b=5}};

clang/docs/ReleaseNotes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,18 @@ Non-comprehensive list of changes in this release
8989
-------------------------------------------------
9090
- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.
9191

92+
- Trapping UBSan (e.g. ``-fsanitize-trap=undefined``) now emits a string describing the reason for
93+
trapping into the generated debug info. This feature allows debuggers (e.g. LLDB) to display
94+
the reason for trapping if the trap is reached. The string is currently encoded in the debug
95+
info as an artificial frame that claims to be inlined at the trap location. The function used
96+
for the artificial frame is an artificial function whose name encodes the reason for trapping.
97+
The encoding used is currently the same as ``__builtin_verbose_trap`` but might change in the future.
98+
This feature is enabled by default but can be disabled by compiling with
99+
``-fno-sanitize-annotate-debug-info-traps``.
92100

93101
New Compiler Flags
94102
------------------
103+
- New option ``-fno-sanitize-annotate-debug-info-traps`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).
95104

96105
Deprecated Compiler Flags
97106
-------------------------

0 commit comments

Comments
 (0)