File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -1604,13 +1604,10 @@ class SyclKernelBodyCreator
1604
1604
}
1605
1605
1606
1606
bool leaveStruct (const CXXRecordDecl *, FieldDecl *FD) final {
1607
- QualType FieldTy = FD->getType ();
1608
- const CXXRecordDecl *RD = FieldTy->getAsCXXRecordDecl ();
1609
-
1610
- // Kernel Object field is an array of structs. Handle struct array element.
1611
- if (const ConstantArrayType *CAT =
1612
- SemaRef.Context .getAsConstantArrayType (FieldTy))
1613
- RD = CAT->getElementType ()->getAsCXXRecordDecl ();
1607
+ // Handle struct when kernel object field is struct type or array of
1608
+ // structs.
1609
+ const CXXRecordDecl *RD =
1610
+ FD->getType ()->getBaseElementTypeUnsafe ()->getAsCXXRecordDecl ();
1614
1611
1615
1612
// Initializers for accessors inside stream not added.
1616
1613
if (!Util::isSyclStreamType (FD->getType ()))
You can’t perform that action at this time.
0 commit comments