Skip to content

Commit a2fcef0

Browse files
authored
merge main into amd-staging (#465)
2 parents e6f2ede + b012ac8 commit a2fcef0

File tree

92 files changed

+544
-452
lines changed

Some content is hidden

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

92 files changed

+544
-452
lines changed

bolt/lib/Profile/DataAggregator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1321,7 +1321,8 @@ std::error_code DataAggregator::parseAggregatedLBREntry() {
13211321
}
13221322

13231323
using SSI = StringSwitch<int>;
1324-
AddrNum = SSI(Str).Cases("T", "R", 3).Case("S", 1).Case("E", 0).Default(2);
1324+
AddrNum =
1325+
SSI(Str).Cases({"T", "R"}, 3).Case("S", 1).Case("E", 0).Default(2);
13251326
CounterNum = SSI(Str).Case("B", 2).Case("E", 0).Default(1);
13261327
}
13271328

clang-tools-extra/clang-tidy/bugprone/UncheckedStringToNumberConversionCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ enum class ConversionKind {
5151

5252
static ConversionKind classifyConversionFunc(const FunctionDecl *FD) {
5353
return llvm::StringSwitch<ConversionKind>(FD->getName())
54-
.Cases("atoi", "atol", ConversionKind::ToInt)
54+
.Cases({"atoi", "atol"}, ConversionKind::ToInt)
5555
.Case("atoll", ConversionKind::ToLongInt)
5656
.Case("atof", ConversionKind::ToDouble)
5757
.Default(ConversionKind::None);

clang-tools-extra/clangd/support/DirectiveTree.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,8 @@ class BranchChooser {
305305
if (&Value >= Tokens.end() || &Value.nextNC() < Tokens.end())
306306
return std::nullopt;
307307
return llvm::StringSwitch<std::optional<bool>>(Value.text())
308-
.Cases("true", "1", true)
309-
.Cases("false", "0", false)
308+
.Cases({"true", "1"}, true)
309+
.Cases({"false", "0"}, false)
310310
.Default(std::nullopt);
311311
}
312312

clang/lib/AST/CommentSema.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static ParamCommandPassDirection getParamPassDirection(StringRef Arg) {
225225
return llvm::StringSwitch<ParamCommandPassDirection>(Arg)
226226
.Case("[in]", ParamCommandPassDirection::In)
227227
.Case("[out]", ParamCommandPassDirection::Out)
228-
.Cases("[in,out]", "[out,in]", ParamCommandPassDirection::InOut)
228+
.Cases({"[in,out]", "[out,in]"}, ParamCommandPassDirection::InOut)
229229
.Default(static_cast<ParamCommandPassDirection>(-1));
230230
}
231231

clang/lib/Basic/Targets/AVR.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@ struct LLVM_LIBRARY_VISIBILITY MCUInfo {
3030

3131
// NOTE: This list has been synchronized with gcc-avr 5.4.0 and avr-libc 2.0.0.
3232
static MCUInfo AVRMcus[] = {
33-
{"avr1", NULL, "1", 0},
33+
{"avr1", nullptr, "1", 0},
3434
{"at90s1200", "__AVR_AT90S1200__", "1", 0},
3535
{"attiny11", "__AVR_ATtiny11__", "1", 0},
3636
{"attiny12", "__AVR_ATtiny12__", "1", 0},
3737
{"attiny15", "__AVR_ATtiny15__", "1", 0},
3838
{"attiny28", "__AVR_ATtiny28__", "1", 0},
39-
{"avr2", NULL, "2", 1},
39+
{"avr2", nullptr, "2", 1},
4040
{"at90s2313", "__AVR_AT90S2313__", "2", 1},
4141
{"at90s2323", "__AVR_AT90S2323__", "2", 1},
4242
{"at90s2333", "__AVR_AT90S2333__", "2", 1},
@@ -50,7 +50,7 @@ static MCUInfo AVRMcus[] = {
5050
{"at90s8515", "__AVR_AT90S8515__", "2", 1},
5151
{"at90c8534", "__AVR_AT90c8534__", "2", 1},
5252
{"at90s8535", "__AVR_AT90S8535__", "2", 1},
53-
{"avr25", NULL, "25", 1},
53+
{"avr25", nullptr, "25", 1},
5454
{"ata5272", "__AVR_ATA5272__", "25", 1},
5555
{"ata6616c", "__AVR_ATA6616c__", "25", 1},
5656
{"attiny13", "__AVR_ATtiny13__", "25", 1},
@@ -80,13 +80,13 @@ static MCUInfo AVRMcus[] = {
8080
{"attiny48", "__AVR_ATtiny48__", "25", 1},
8181
{"attiny88", "__AVR_ATtiny88__", "25", 1},
8282
{"attiny828", "__AVR_ATtiny828__", "25", 1},
83-
{"avr3", NULL, "3", 1},
83+
{"avr3", nullptr, "3", 1},
8484
{"at43usb355", "__AVR_AT43USB355__", "3", 1},
8585
{"at76c711", "__AVR_AT76C711__", "3", 1},
86-
{"avr31", NULL, "31", 1},
86+
{"avr31", nullptr, "31", 1},
8787
{"atmega103", "__AVR_ATmega103__", "31", 1},
8888
{"at43usb320", "__AVR_AT43USB320__", "31", 1},
89-
{"avr35", NULL, "35", 1},
89+
{"avr35", nullptr, "35", 1},
9090
{"attiny167", "__AVR_ATtiny167__", "35", 1},
9191
{"at90usb82", "__AVR_AT90USB82__", "35", 1},
9292
{"at90usb162", "__AVR_AT90USB162__", "35", 1},
@@ -97,7 +97,7 @@ static MCUInfo AVRMcus[] = {
9797
{"atmega16u2", "__AVR_ATmega16U2__", "35", 1},
9898
{"atmega32u2", "__AVR_ATmega32U2__", "35", 1},
9999
{"attiny1634", "__AVR_ATtiny1634__", "35", 1},
100-
{"avr4", NULL, "4", 1},
100+
{"avr4", nullptr, "4", 1},
101101
{"atmega8", "__AVR_ATmega8__", "4", 1},
102102
{"ata6289", "__AVR_ATA6289__", "4", 1},
103103
{"atmega8a", "__AVR_ATmega8A__", "4", 1},
@@ -123,7 +123,7 @@ static MCUInfo AVRMcus[] = {
123123
{"at90pwm3", "__AVR_AT90PWM3__", "4", 1},
124124
{"at90pwm3b", "__AVR_AT90PWM3B__", "4", 1},
125125
{"at90pwm81", "__AVR_AT90PWM81__", "4", 1},
126-
{"avr5", NULL, "5", 1},
126+
{"avr5", nullptr, "5", 1},
127127
{"ata5702m322", "__AVR_ATA5702M322__", "5", 1},
128128
{"ata5782", "__AVR_ATA5782__", "5", 1},
129129
{"ata5790", "__AVR_ATA5790__", "5", 1},
@@ -230,7 +230,7 @@ static MCUInfo AVRMcus[] = {
230230
{"at90scr100", "__AVR_AT90SCR100__", "5", 1},
231231
{"at94k", "__AVR_AT94K__", "5", 1},
232232
{"m3000", "__AVR_AT000__", "5", 1},
233-
{"avr51", NULL, "51", 2},
233+
{"avr51", nullptr, "51", 2},
234234
{"atmega128", "__AVR_ATmega128__", "51", 2},
235235
{"atmega128a", "__AVR_ATmega128A__", "51", 2},
236236
{"atmega1280", "__AVR_ATmega1280__", "51", 2},
@@ -243,12 +243,12 @@ static MCUInfo AVRMcus[] = {
243243
{"at90can128", "__AVR_AT90CAN128__", "51", 2},
244244
{"at90usb1286", "__AVR_AT90USB1286__", "51", 2},
245245
{"at90usb1287", "__AVR_AT90USB1287__", "51", 2},
246-
{"avr6", NULL, "6", 4},
246+
{"avr6", nullptr, "6", 4},
247247
{"atmega2560", "__AVR_ATmega2560__", "6", 4},
248248
{"atmega2561", "__AVR_ATmega2561__", "6", 4},
249249
{"atmega256rfr2", "__AVR_ATmega256RFR2__", "6", 4},
250250
{"atmega2564rfr2", "__AVR_ATmega2564RFR2__", "6", 4},
251-
{"avrxmega2", NULL, "102", 1},
251+
{"avrxmega2", nullptr, "102", 1},
252252
{"atxmega16a4", "__AVR_ATxmega16A4__", "102", 1},
253253
{"atxmega16a4u", "__AVR_ATxmega16A4U__", "102", 1},
254254
{"atxmega16c4", "__AVR_ATxmega16C4__", "102", 1},
@@ -262,7 +262,7 @@ static MCUInfo AVRMcus[] = {
262262
{"atxmega32e5", "__AVR_ATxmega32E5__", "102", 1},
263263
{"atxmega16e5", "__AVR_ATxmega16E5__", "102", 1},
264264
{"atxmega8e5", "__AVR_ATxmega8E5__", "102", 1},
265-
{"avrxmega4", NULL, "104", 1},
265+
{"avrxmega4", nullptr, "104", 1},
266266
{"atxmega64a3", "__AVR_ATxmega64A3__", "104", 1},
267267
{"atxmega64a3u", "__AVR_ATxmega64A3U__", "104", 1},
268268
{"atxmega64a4u", "__AVR_ATxmega64A4U__", "104", 1},
@@ -271,10 +271,10 @@ static MCUInfo AVRMcus[] = {
271271
{"atxmega64c3", "__AVR_ATxmega64C3__", "104", 1},
272272
{"atxmega64d3", "__AVR_ATxmega64D3__", "104", 1},
273273
{"atxmega64d4", "__AVR_ATxmega64D4__", "104", 1},
274-
{"avrxmega5", NULL, "105", 1},
274+
{"avrxmega5", nullptr, "105", 1},
275275
{"atxmega64a1", "__AVR_ATxmega64A1__", "105", 1},
276276
{"atxmega64a1u", "__AVR_ATxmega64A1U__", "105", 1},
277-
{"avrxmega6", NULL, "106", 6},
277+
{"avrxmega6", nullptr, "106", 6},
278278
{"atxmega128a3", "__AVR_ATxmega128A3__", "106", 2},
279279
{"atxmega128a3u", "__AVR_ATxmega128A3U__", "106", 2},
280280
{"atxmega128b1", "__AVR_ATxmega128B1__", "106", 2},
@@ -294,11 +294,11 @@ static MCUInfo AVRMcus[] = {
294294
{"atxmega256d3", "__AVR_ATxmega256D3__", "106", 4},
295295
{"atxmega384c3", "__AVR_ATxmega384C3__", "106", 6},
296296
{"atxmega384d3", "__AVR_ATxmega384D3__", "106", 6},
297-
{"avrxmega7", NULL, "107", 2},
297+
{"avrxmega7", nullptr, "107", 2},
298298
{"atxmega128a1", "__AVR_ATxmega128A1__", "107", 2},
299299
{"atxmega128a1u", "__AVR_ATxmega128A1U__", "107", 2},
300300
{"atxmega128a4u", "__AVR_ATxmega128A4U__", "107", 2},
301-
{"avrtiny", NULL, "100", 0},
301+
{"avrtiny", nullptr, "100", 0},
302302
{"attiny4", "__AVR_ATtiny4__", "100", 0},
303303
{"attiny5", "__AVR_ATtiny5__", "100", 0},
304304
{"attiny9", "__AVR_ATtiny9__", "100", 0},
@@ -307,7 +307,7 @@ static MCUInfo AVRMcus[] = {
307307
{"attiny40", "__AVR_ATtiny40__", "100", 0},
308308
{"attiny102", "__AVR_ATtiny102__", "100", 0},
309309
{"attiny104", "__AVR_ATtiny104__", "100", 0},
310-
{"avrxmega3", NULL, "103", 1},
310+
{"avrxmega3", nullptr, "103", 1},
311311
{"attiny202", "__AVR_ATtiny202__", "103", 1},
312312
{"attiny402", "__AVR_ATtiny402__", "103", 1},
313313
{"attiny204", "__AVR_ATtiny204__", "103", 1},

clang/lib/Basic/Targets/NVPTX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ ArrayRef<const char *> NVPTXTargetInfo::getGCCRegNames() const {
171171

172172
bool NVPTXTargetInfo::hasFeature(StringRef Feature) const {
173173
return llvm::StringSwitch<bool>(Feature)
174-
.Cases("ptx", "nvptx", true)
174+
.Cases({"ptx", "nvptx"}, true)
175175
.Default(false);
176176
}
177177

clang/lib/Basic/Targets/PPC.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
125125
.Cases({"power3", "pwr3"}, ArchDefinePpcgr)
126126
.Cases({"power4", "pwr4"},
127127
ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
128-
.Cases("power5", "pwr5",
129-
ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr |
130-
ArchDefinePpcsq)
128+
.Cases({"power5", "pwr5"}, ArchDefinePwr5 | ArchDefinePwr4 |
129+
ArchDefinePpcgr | ArchDefinePpcsq)
131130
.Cases({"power5x", "pwr5x"},
132131
ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 |
133132
ArchDefinePpcgr | ArchDefinePpcsq)
@@ -166,7 +165,7 @@ class LLVM_LIBRARY_VISIBILITY PPCTargetInfo : public TargetInfo {
166165
ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 |
167166
ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 |
168167
ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq)
169-
.Cases("8548", "e500", ArchDefineE500)
168+
.Cases({"8548", "e500"}, ArchDefineE500)
170169
.Default(ArchDefineNone);
171170
}
172171
return CPUKnown;

clang/lib/CIR/CodeGen/CIRGenOpenACCClause.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class OpenACCClauseCIREmitter final
126126
.CaseLower("default", mlir::acc::DeviceType::Default)
127127
.CaseLower("host", mlir::acc::DeviceType::Host)
128128
.CaseLower("multicore", mlir::acc::DeviceType::Multicore)
129-
.CasesLower("nvidia", "acc_device_nvidia",
129+
.CasesLower({"nvidia", "acc_device_nvidia"},
130130
mlir::acc::DeviceType::Nvidia)
131131
.CaseLower("radeon", mlir::acc::DeviceType::Radeon);
132132
}

clang/lib/CodeGen/BackendUtil.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ getCodeModel(const CodeGenOptions &CodeGenOpts) {
313313
.Case("kernel", llvm::CodeModel::Kernel)
314314
.Case("medium", llvm::CodeModel::Medium)
315315
.Case("large", llvm::CodeModel::Large)
316-
.Cases("default", "", ~1u)
316+
.Cases({"default", ""}, ~1u)
317317
.Default(~0u);
318318
assert(CodeModel != ~0u && "invalid code model!");
319319
if (CodeModel == ~1u)

clang/lib/Driver/ToolChains/Arch/M68k.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ std::string m68k::getM68kTargetCPU(const ArgList &Args) {
3636
return "generic";
3737

3838
return llvm::StringSwitch<std::string>(CPUName)
39-
.Cases("m68000", "68000", "M68000")
40-
.Cases("m68010", "68010", "M68010")
41-
.Cases("m68020", "68020", "M68020")
42-
.Cases("m68030", "68030", "M68030")
43-
.Cases("m68040", "68040", "M68040")
44-
.Cases("m68060", "68060", "M68060")
39+
.Cases({"m68000", "68000"}, "M68000")
40+
.Cases({"m68010", "68010"}, "M68010")
41+
.Cases({"m68020", "68020"}, "M68020")
42+
.Cases({"m68030", "68030"}, "M68030")
43+
.Cases({"m68040", "68040"}, "M68040")
44+
.Cases({"m68060", "68060"}, "M68060")
4545
.Default(CPUName.str());
4646
}
4747
// FIXME: Throw error when multiple sub-architecture flag exist

0 commit comments

Comments
 (0)