Skip to content

[NFC][SYCL][clang] Fix -Wunused-private-field warnings in SemaSYCL #9098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions clang/lib/Sema/SemaSYCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2887,7 +2887,6 @@ class SyclKernelBodyCreator : public SyclKernelFieldHandler {
llvm::SmallVector<std::pair<InitializedEntity, uint64_t>, 8> ArrayInfos;
VarDecl *KernelObjClone;
InitializedEntity VarEntity;
const CXXRecordDecl *KernelObj;
llvm::SmallVector<Expr *, 16> MemberExprBases;
llvm::SmallVector<Expr *, 16> ArrayParamBases;
FunctionDecl *KernelCallerFunc;
Expand Down Expand Up @@ -3419,7 +3418,7 @@ class SyclKernelBodyCreator : public SyclKernelFieldHandler {
KernelObjClone(createKernelObjClone(S.getASTContext(),
DC.getKernelDecl(), KernelObj)),
VarEntity(InitializedEntity::InitializeVariable(KernelObjClone)),
KernelObj(KernelObj), KernelCallerFunc(KernelCallerFunc),
KernelCallerFunc(KernelCallerFunc),
KernelCallerSrcLoc(KernelCallerFunc->getLocation()),
IsESIMD(IsSIMDKernel), CallOperator(CallOperator) {
CollectionInitExprs.push_back(createInitListExpr(KernelObj));
Expand Down Expand Up @@ -3624,7 +3623,6 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
int64_t CurOffset = 0;
llvm::SmallVector<size_t, 16> ArrayBaseOffsets;
int StructDepth = 0;
bool IsESIMD = false;

// A series of functions to calculate the change in offset based on the type.
int64_t offsetOf(const FieldDecl *FD, QualType ArgTy) const {
Expand Down Expand Up @@ -3656,7 +3654,7 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
SyclKernelIntHeaderCreator(bool IsESIMD, Sema &S, SYCLIntegrationHeader &H,
const CXXRecordDecl *KernelObj, QualType NameType,
FunctionDecl *KernelFunc)
: SyclKernelFieldHandler(S), Header(H), IsESIMD(IsESIMD) {
: SyclKernelFieldHandler(S), Header(H) {

// The header needs to access the kernel object size.
int64_t ObjSize = SemaRef.getASTContext()
Expand Down