Skip to content

Commit d7a4715

Browse files
committed
Revert "Update for StringSwitch::Cases deprecation; NFC (KhronosGroup#3407)"
This reverts commit 35827fe.
1 parent a3a5de7 commit d7a4715

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

lib/SPIRV/OCLToSPIRV.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ getAtomicPointerMemorySemanticsMemoryMask(const Value *Ptr,
152152

153153
static size_t getOCLCpp11AtomicMaxNumOps(StringRef Name) {
154154
return StringSwitch<size_t>(Name)
155-
.Cases({"load", "flag_test_and_set", "flag_clear"}, 3)
156-
.Cases({"store", "exchange"}, 4)
155+
.Cases("load", "flag_test_and_set", "flag_clear", 3)
156+
.Cases("store", "exchange", 4)
157157
.StartsWith("compare_exchange", 6)
158158
.StartsWith("fetch", 4)
159159
.Default(0);

lib/SPIRV/SPIRVUtil.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,11 @@ static std::string demangleBuiltinOpenCLTypeName(StringRef MangledStructName) {
620620
/// floating point type.
621621
static Type *parsePrimitiveType(LLVMContext &Ctx, StringRef Name) {
622622
return StringSwitch<Type *>(Name)
623-
.Cases({"char", "signed char", "unsigned char"}, Type::getInt8Ty(Ctx))
624-
.Cases({"short", "unsigned short"}, Type::getInt16Ty(Ctx))
625-
.Cases({"int", "unsigned int"}, Type::getInt32Ty(Ctx))
626-
.Cases({"long", "unsigned long"}, Type::getInt64Ty(Ctx))
627-
.Cases({"long long", "unsigned long long"}, Type::getInt64Ty(Ctx))
623+
.Cases("char", "signed char", "unsigned char", Type::getInt8Ty(Ctx))
624+
.Cases("short", "unsigned short", Type::getInt16Ty(Ctx))
625+
.Cases("int", "unsigned int", Type::getInt32Ty(Ctx))
626+
.Cases("long", "unsigned long", Type::getInt64Ty(Ctx))
627+
.Cases("long long", "unsigned long long", Type::getInt64Ty(Ctx))
628628
.Case("half", Type::getHalfTy(Ctx))
629629
.Case("float", Type::getFloatTy(Ctx))
630630
.Case("double", Type::getDoubleTy(Ctx))

lib/SPIRV/SPIRVWriter.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5343,16 +5343,16 @@ LLVMToSPIRVBase::getFPBuiltinType(IntrinsicInst *II, StringRef &OpName) {
53435343
OpName = Name.split('.').first;
53445344
FPBuiltinType Type =
53455345
StringSwitch<FPBuiltinType>(OpName)
5346-
.Cases({"fadd", "fsub", "fmul", "fdiv", "frem"},
5346+
.Cases("fadd", "fsub", "fmul", "fdiv", "frem",
53475347
FPBuiltinType::REGULAR_MATH)
5348-
.Cases({"sin", "cos", "tan"}, FPBuiltinType::EXT_1OPS)
5349-
.Cases({"sinh", "cosh", "tanh"}, FPBuiltinType::EXT_1OPS)
5350-
.Cases({"asin", "acos", "atan"}, FPBuiltinType::EXT_1OPS)
5351-
.Cases({"asinh", "acosh", "atanh"}, FPBuiltinType::EXT_1OPS)
5352-
.Cases({"exp", "exp2", "exp10", "expm1"}, FPBuiltinType::EXT_1OPS)
5353-
.Cases({"log", "log2", "log10", "log1p"}, FPBuiltinType::EXT_1OPS)
5354-
.Cases({"sqrt", "rsqrt", "erf", "erfc"}, FPBuiltinType::EXT_1OPS)
5355-
.Cases({"atan2", "pow", "hypot", "ldexp"}, FPBuiltinType::EXT_2OPS)
5348+
.Cases("sin", "cos", "tan", FPBuiltinType::EXT_1OPS)
5349+
.Cases("sinh", "cosh", "tanh", FPBuiltinType::EXT_1OPS)
5350+
.Cases("asin", "acos", "atan", FPBuiltinType::EXT_1OPS)
5351+
.Cases("asinh", "acosh", "atanh", FPBuiltinType::EXT_1OPS)
5352+
.Cases("exp", "exp2", "exp10", "expm1", FPBuiltinType::EXT_1OPS)
5353+
.Cases("log", "log2", "log10", "log1p", FPBuiltinType::EXT_1OPS)
5354+
.Cases("sqrt", "rsqrt", "erf", "erfc", FPBuiltinType::EXT_1OPS)
5355+
.Cases("atan2", "pow", "hypot", "ldexp", FPBuiltinType::EXT_2OPS)
53565356
.Case("sincos", FPBuiltinType::EXT_3OPS)
53575357
.Default(FPBuiltinType::UNKNOWN);
53585358
return Type;

0 commit comments

Comments
 (0)