Skip to content

Commit 269d661

Browse files
committed
Minor change to use switch-case instead of if-then-else
Signed-off-by: Arvind Sudarsanam <[email protected]>
1 parent 0d5af17 commit 269d661

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

llvm/include/llvm/Support/SYCLPropertySetIO.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ class SYCLPropertyValue {
7474
SYCLPropertyValue() = default;
7575

7676
SYCLPropertyValue(Type Ty) {
77-
if (Ty == UInt32)
78-
Val = (uint32_t)0;
79-
else if (Ty == ByteArray)
80-
Val = std::unique_ptr<std::byte, Deleter>(new std::byte[1], Deleter{});
81-
else
82-
llvm_unreachable_internal("unsupported SYCL property type");
77+
switch (Ty) {
78+
case UInt32:
79+
Val = (uint32_t)0;
80+
break;
81+
case ByteArray:
82+
Val = std::unique_ptr<std::byte, Deleter>(new std::byte[1], Deleter{});
83+
break;
84+
default:
85+
llvm_unreachable_internal("unsupported SYCL property type");
86+
}
8387
}
8488
SYCLPropertyValue(uint32_t Val) : Val({Val}) {}
8589
SYCLPropertyValue(const std::byte *Data, SizeTy DataBitSize);

0 commit comments

Comments
 (0)