Skip to content

Commit 1bdb44c

Browse files
authored
[SYCL][NFC] Fix build errors revealed by self build. (#3132)
1 parent 9e0f20e commit 1bdb44c

File tree

4 files changed

+11
-15
lines changed

4 files changed

+11
-15
lines changed

clang/lib/CodeGen/CGSYCLRuntime.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,16 @@ bool CGSYCLRuntime::actOnFunctionStart(const FunctionDecl &FD,
7070
switch (Scope->getLevel()) {
7171
case SYCLScopeAttr::Level::WorkGroup:
7272
F.setMetadata(WG_SCOPE_MD_ID, llvm::MDNode::get(F.getContext(), {}));
73-
break;
73+
return true;
7474
case SYCLScopeAttr::Level::WorkItem:
7575
F.setMetadata(WI_SCOPE_MD_ID, llvm::MDNode::get(F.getContext(), {}));
7676
if (isPFWI(FD))
7777
// also emit specific marker for parallel_for_work_item, as it needs to
7878
// be handled specially in the SYCL lowering pass
7979
F.setMetadata(PFWI_MD_ID, llvm::MDNode::get(F.getContext(), {}));
80-
break;
81-
default:
82-
llvm_unreachable("unknown sycl scope");
80+
return true;
8381
}
84-
return true;
82+
llvm_unreachable("unknown sycl scope");
8583
}
8684

8785
void CGSYCLRuntime::emitWorkGroupLocalVarDecl(CodeGenFunction &CGF,

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8357,8 +8357,6 @@ void FileTableTform::ConstructJob(Compilation &C, const JobAction &JA,
83578357
addArgs(CmdArgs, TCArgs, {Arg});
83588358
break;
83598359
}
8360-
default:
8361-
llvm_unreachable("unknown file table transformation kind");
83628360
}
83638361
}
83648362
// 2) add output option

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,12 +1466,12 @@ class SyclKernelUnionChecker : public SyclKernelFieldHandler {
14661466
return isValid();
14671467
}
14681468

1469-
bool enterUnion(const CXXRecordDecl *RD, FieldDecl *FD) {
1469+
bool enterUnion(const CXXRecordDecl *RD, FieldDecl *FD) override {
14701470
++UnionCount;
14711471
return true;
14721472
}
14731473

1474-
bool leaveUnion(const CXXRecordDecl *RD, FieldDecl *FD) {
1474+
bool leaveUnion(const CXXRecordDecl *RD, FieldDecl *FD) override {
14751475
--UnionCount;
14761476
return true;
14771477
}
@@ -3477,9 +3477,9 @@ static const char *paramKind2Str(KernelParamKind K) {
34773477
CASE(std_layout);
34783478
CASE(sampler);
34793479
CASE(pointer);
3480-
default:
3481-
return "<ERROR>";
34823480
}
3481+
return "<ERROR>";
3482+
34833483
#undef CASE
34843484
}
34853485

clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,9 +218,9 @@ static StringRef offloadKindToString(OffloadKind Kind) {
218218
return "hip";
219219
case OffloadKind::SYCL:
220220
return "sycl";
221-
default:
222-
llvm_unreachable("bad offload kind");
223221
}
222+
llvm_unreachable("bad offload kind");
223+
224224
return "<ERROR>";
225225
}
226226

@@ -234,9 +234,9 @@ static StringRef formatToString(BinaryImageFormat Fmt) {
234234
return "llvmbc";
235235
case BinaryImageFormat::native:
236236
return "native";
237-
default:
238-
llvm_unreachable("bad format");
239237
}
238+
llvm_unreachable("bad format");
239+
240240
return "<ERROR>";
241241
}
242242

0 commit comments

Comments
 (0)