Skip to content

Commit 91954fd

Browse files
Removed unused variable and modified comments
Signed-off-by: Elizabeth Andrews <[email protected]>
1 parent 7b81a3e commit 91954fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -820,13 +820,16 @@ static void VisitRecordHelper(CXXRecordDecl *Owner,
820820
for (const auto &Base : Range) {
821821
(void)std::initializer_list<int>{(handlers.enterField(Owner, Base), 0)...};
822822
QualType BaseTy = Base.getType();
823+
// Handle accessor class as base
823824
if (Util::isSyclAccessorType(BaseTy)) {
824825
(void)std::initializer_list<int>{
825826
(handlers.handleSyclAccessorType(Base, BaseTy), 0)...};
826827
} else if (Util::isSyclStreamType(BaseTy)) {
828+
// Handle stream class as base
827829
(void)std::initializer_list<int>{
828830
(handlers.handleSyclStreamType(Base, BaseTy), 0)...};
829831
} else
832+
// For all other bases, visit the record
830833
VisitRecord(Owner, Base, BaseTy->getAsCXXRecordDecl(), handlers...);
831834
(void)std::initializer_list<int>{(handlers.leaveField(Owner, Base), 0)...};
832835
}
@@ -1287,7 +1290,6 @@ class SyclKernelBodyCreator
12871290
llvm::SmallVector<Expr *, 16> MemberExprBases;
12881291
uint64_t ArrayIndex;
12891292
FunctionDecl *KernelCallerFunc;
1290-
bool ArrayState;
12911293

12921294
// Using the statements/init expressions that we've created, this generates
12931295
// the kernel body compound stmt. CompoundStmt needs to know its number of
@@ -1505,8 +1507,7 @@ class SyclKernelBodyCreator
15051507
KernelObjClone(createKernelObjClone(S.getASTContext(),
15061508
DC.getKernelDecl(), KernelObj)),
15071509
VarEntity(InitializedEntity::InitializeVariable(KernelObjClone)),
1508-
KernelObj(KernelObj), KernelCallerFunc(KernelCallerFunc),
1509-
ArrayState(false) {
1510+
KernelObj(KernelObj), KernelCallerFunc(KernelCallerFunc) {
15101511
markParallelWorkItemCalls();
15111512

15121513
Stmt *DS = new (S.Context) DeclStmt(DeclGroupRef(KernelObjClone),
@@ -1615,6 +1616,7 @@ class SyclKernelBodyCreator
16151616
if (!Util::isSyclStreamType(FD->getType()))
16161617
addStructInit(RD);
16171618
// Pop out unused initializers created in handleSyclAccesorType
1619+
// for accessors inside stream class.
16181620
else {
16191621
for (const auto &Field : RD->fields()) {
16201622
QualType FieldTy = Field->getType();

0 commit comments

Comments
 (0)