Skip to content

Commit dbee4a5

Browse files
author
git apple-llvm automerger
committed
Merge commit 'd86da4efee20' from llvm.org/main into next
2 parents 7cf75e6 + d86da4e commit dbee4a5

File tree

19 files changed

+72
-68
lines changed

19 files changed

+72
-68
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2665,8 +2665,9 @@ void RewriteInstance::readRelocations(const SectionRef &Section) {
26652665
return;
26662666
}
26672667
const bool SkipRelocs = StringSwitch<bool>(RelocatedSectionName)
2668-
.Cases(".plt", ".rela.plt", ".got.plt",
2669-
".eh_frame", ".gcc_except_table", true)
2668+
.Cases({".plt", ".rela.plt", ".got.plt",
2669+
".eh_frame", ".gcc_except_table"},
2670+
true)
26702671
.Default(false);
26712672
if (SkipRelocs) {
26722673
LLVM_DEBUG(

clang/lib/AST/Decl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3397,11 +3397,11 @@ bool FunctionDecl::isMSVCRTEntryPoint() const {
33973397
return false;
33983398

33993399
return llvm::StringSwitch<bool>(getName())
3400-
.Cases("main", // an ANSI console app
3401-
"wmain", // a Unicode console App
3402-
"WinMain", // an ANSI GUI app
3403-
"wWinMain", // a Unicode GUI app
3404-
"DllMain", // a DLL
3400+
.Cases({"main", // an ANSI console app
3401+
"wmain", // a Unicode console App
3402+
"WinMain", // an ANSI GUI app
3403+
"wWinMain", // a Unicode GUI app
3404+
"DllMain"}, // a DLL
34053405
true)
34063406
.Default(false);
34073407
}

clang/lib/Basic/Targets/Mips.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ void MipsTargetInfo::fillValidCPUList(
6868

6969
unsigned MipsTargetInfo::getISARev() const {
7070
return llvm::StringSwitch<unsigned>(getCPU())
71-
.Cases("mips32", "mips64", 1)
72-
.Cases("mips32r2", "mips64r2", "octeon", "octeon+", 2)
73-
.Cases("mips32r3", "mips64r3", 3)
74-
.Cases("mips32r5", "mips64r5", "p5600", 5)
75-
.Cases("mips32r6", "mips64r6", "i6400", "i6500", 6)
71+
.Cases({"mips32", "mips64"}, 1)
72+
.Cases({"mips32r2", "mips64r2", "octeon", "octeon+"}, 2)
73+
.Cases({"mips32r3", "mips64r3"}, 3)
74+
.Cases({"mips32r5", "mips64r5", "p5600"}, 5)
75+
.Cases({"mips32r6", "mips64r6", "i6400", "i6500"}, 6)
7676
.Default(0);
7777
}
7878

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,9 +482,9 @@ bool mips::isFPXXDefault(const llvm::Triple &Triple, StringRef CPUName,
482482
return false;
483483

484484
return llvm::StringSwitch<bool>(CPUName)
485-
.Cases("mips2", "mips3", "mips4", "mips5", true)
486-
.Cases("mips32", "mips32r2", "mips32r3", "mips32r5", true)
487-
.Cases("mips64", "mips64r2", "mips64r3", "mips64r5", true)
485+
.Cases({"mips2", "mips3", "mips4", "mips5"}, true)
486+
.Cases({"mips32", "mips32r2", "mips32r3", "mips32r5"}, true)
487+
.Cases({"mips64", "mips64r2", "mips64r3", "mips64r5"}, true)
488488
.Default(false);
489489
}
490490

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ llvm::Triple::ArchType darwin::getArchTypeForMachOArchName(StringRef Str) {
5353
// translation.
5454

5555
return llvm::StringSwitch<llvm::Triple::ArchType>(Str)
56-
.Cases("i386", "i486", "i486SX", "i586", "i686", llvm::Triple::x86)
57-
.Cases("pentium", "pentpro", "pentIIm3", "pentIIm5", "pentium4",
56+
.Cases({"i386", "i486", "i486SX", "i586", "i686"}, llvm::Triple::x86)
57+
.Cases({"pentium", "pentpro", "pentIIm3", "pentIIm5", "pentium4"},
5858
llvm::Triple::x86)
59-
.Cases("x86_64", "x86_64h", llvm::Triple::x86_64)
59+
.Cases({"x86_64", "x86_64h"}, llvm::Triple::x86_64)
6060
// This is derived from the driver.
61-
.Cases("arm", "armv4t", "armv5", "armv6", "armv6m", llvm::Triple::arm)
62-
.Cases("armv7", "armv7em", "armv7k", "armv7m", llvm::Triple::arm)
63-
.Cases("armv7s", "xscale", llvm::Triple::arm)
64-
.Cases("arm64", "arm64e", llvm::Triple::aarch64)
61+
.Cases({"arm", "armv4t", "armv5", "armv6", "armv6m"}, llvm::Triple::arm)
62+
.Cases({"armv7", "armv7em", "armv7k", "armv7m"}, llvm::Triple::arm)
63+
.Cases({"armv7s", "xscale"}, llvm::Triple::arm)
64+
.Cases({"arm64", "arm64e"}, llvm::Triple::aarch64)
6565
.Case("arm64_32", llvm::Triple::aarch64_32)
6666
.Case("r600", llvm::Triple::r600)
6767
.Case("amdgcn", llvm::Triple::amdgcn)

clang/lib/Frontend/FrontendAction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ static std::error_code collectModuleHeaderIncludes(
638638
// Check whether this entry has an extension typically associated with
639639
// headers.
640640
if (!llvm::StringSwitch<bool>(llvm::sys::path::extension(Dir->path()))
641-
.Cases(".h", ".H", ".hh", ".hpp", true)
641+
.Cases({".h", ".H", ".hh", ".hpp"}, true)
642642
.Default(false))
643643
continue;
644644

clang/lib/Lex/PPLexerChange.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ void Preprocessor::diagnoseMissingHeaderInUmbrellaDir(const Module &Mod) {
302302
// Check whether this entry has an extension typically associated with
303303
// headers.
304304
if (!StringSwitch<bool>(llvm::sys::path::extension(Entry->path()))
305-
.Cases(".h", ".H", ".hh", ".hpp", true)
305+
.Cases({".h", ".H", ".hh", ".hpp"}, true)
306306
.Default(false))
307307
continue;
308308

clang/lib/Parse/ParsePragma.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,10 +1419,11 @@ bool Parser::HandlePragmaLoopHint(LoopHint &Hint) {
14191419

14201420
// Return a valid hint if pragma unroll or nounroll were specified
14211421
// without an argument.
1422-
auto IsLoopHint = llvm::StringSwitch<bool>(PragmaNameInfo->getName())
1423-
.Cases("unroll", "nounroll", "unroll_and_jam",
1424-
"nounroll_and_jam", true)
1425-
.Default(false);
1422+
auto IsLoopHint =
1423+
llvm::StringSwitch<bool>(PragmaNameInfo->getName())
1424+
.Cases({"unroll", "nounroll", "unroll_and_jam", "nounroll_and_jam"},
1425+
true)
1426+
.Default(false);
14261427

14271428
if (Toks.empty() && IsLoopHint) {
14281429
ConsumeAnnotationToken();

clang/lib/Sema/SemaChecking.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6968,13 +6968,13 @@ StringRef Sema::GetFormatStringTypeName(FormatStringType FST) {
69686968

69696969
FormatStringType Sema::GetFormatStringType(StringRef Flavor) {
69706970
return llvm::StringSwitch<FormatStringType>(Flavor)
6971-
.Cases("gnu_scanf", "scanf", FormatStringType::Scanf)
6972-
.Cases("gnu_printf", "printf", "printf0", "syslog",
6971+
.Cases({"gnu_scanf", "scanf"}, FormatStringType::Scanf)
6972+
.Cases({"gnu_printf", "printf", "printf0", "syslog"},
69736973
FormatStringType::Printf)
6974-
.Cases("NSString", "CFString", FormatStringType::NSString)
6975-
.Cases("gnu_strftime", "strftime", FormatStringType::Strftime)
6976-
.Cases("gnu_strfmon", "strfmon", FormatStringType::Strfmon)
6977-
.Cases("kprintf", "cmn_err", "vcmn_err", "zcmn_err",
6974+
.Cases({"NSString", "CFString"}, FormatStringType::NSString)
6975+
.Cases({"gnu_strftime", "strftime"}, FormatStringType::Strftime)
6976+
.Cases({"gnu_strfmon", "strfmon"}, FormatStringType::Strfmon)
6977+
.Cases({"kprintf", "cmn_err", "vcmn_err", "zcmn_err"},
69786978
FormatStringType::Kprintf)
69796979
.Case("freebsd_kprintf", FormatStringType::FreeBSDKPrintf)
69806980
.Case("os_trace", FormatStringType::OSLog)

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15821,7 +15821,7 @@ QualType Sema::CheckCompareOperands(ExprResult &LHS, ExprResult &RHS,
1582115821
if (auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(DC)) {
1582215822
if (CTSD->isInStdNamespace() &&
1582315823
llvm::StringSwitch<bool>(CTSD->getName())
15824-
.Cases("less", "less_equal", "greater", "greater_equal", true)
15824+
.Cases({"less", "less_equal", "greater", "greater_equal"}, true)
1582515825
.Default(false)) {
1582615826
if (RHSType->isNullPtrType())
1582715827
RHS = ImpCastExprToType(RHS.get(), LHSType, CK_NullToPointer);

0 commit comments

Comments
 (0)