@@ -111,10 +111,10 @@ class Util {
111
111
// / \param Tmpl whether the class is template instantiation or simple record
112
112
static bool isSyclType (QualType Ty, StringRef Name, bool Tmpl = false );
113
113
114
- // / Checks whether given clang type is a standard SYCL API accessor class.
114
+ // / Checks whether given clang type is a standard SYCL API accessor class,
115
+ // / the check assumes the type is templated.
115
116
// / \param Ty the clang type being checked
116
- // / \param Tmpl whether the class is template instantiation or simple record
117
- static bool isSyclAccessorType (QualType Ty, bool Tmpl = false );
117
+ static bool isSyclAccessorType (QualType Ty);
118
118
119
119
// / Checks whether given clang type is a full specialization of the SYCL
120
120
// / specialization constant class.
@@ -1624,7 +1624,7 @@ class SyclKernelFieldChecker : public SyclKernelFieldHandler {
1624
1624
assert (Util::isSyclSpecialType (Ty) &&
1625
1625
" Should only be called on sycl special class types." );
1626
1626
const RecordDecl *RecD = Ty->getAsRecordDecl ();
1627
- if (IsSIMD && !Util::isSyclAccessorType (Ty, true /* Tmp */ ))
1627
+ if (IsSIMD && !Util::isSyclAccessorType (Ty))
1628
1628
return SemaRef.Diag (Loc.getBegin (),
1629
1629
diag::err_sycl_esimd_not_supported_for_type)
1630
1630
<< RecD;
@@ -1966,8 +1966,7 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
1966
1966
const auto *RecordDecl = FieldTy->getAsCXXRecordDecl ();
1967
1967
assert (RecordDecl && " The type must be a RecordDecl" );
1968
1968
llvm::StringLiteral MethodName =
1969
- KernelDecl->hasAttr <SYCLSimdAttr>() &&
1970
- Util::isSyclAccessorType (FieldTy, true /* Tmp*/ )
1969
+ KernelDecl->hasAttr <SYCLSimdAttr>() && Util::isSyclAccessorType (FieldTy)
1971
1970
? InitESIMDMethodName
1972
1971
: InitMethodName;
1973
1972
CXXMethodDecl *InitMethod = getMethodByName (RecordDecl, MethodName);
@@ -1992,7 +1991,7 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
1992
1991
// added, this code needs to be refactored to call
1993
1992
// handleAccessorPropertyList for each class which requires it.
1994
1993
if (ParamTy.getTypePtr ()->isPointerType () &&
1995
- Util::isSyclAccessorType (FieldTy, true /* Tmp */ ))
1994
+ Util::isSyclAccessorType (FieldTy))
1996
1995
handleAccessorType (FieldTy, RecordDecl, FD->getBeginLoc ());
1997
1996
}
1998
1997
LastParamIndex = ParamIndex;
@@ -2087,8 +2086,7 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
2087
2086
const auto *RecordDecl = FieldTy->getAsCXXRecordDecl ();
2088
2087
assert (RecordDecl && " The type must be a RecordDecl" );
2089
2088
llvm::StringLiteral MethodName =
2090
- KernelDecl->hasAttr <SYCLSimdAttr>() &&
2091
- Util::isSyclAccessorType (FieldTy, true /* Tmp*/ )
2089
+ KernelDecl->hasAttr <SYCLSimdAttr>() && Util::isSyclAccessorType (FieldTy)
2092
2090
? InitESIMDMethodName
2093
2091
: InitMethodName;
2094
2092
CXXMethodDecl *InitMethod = getMethodByName (RecordDecl, MethodName);
@@ -2107,7 +2105,7 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
2107
2105
// added, this code needs to be refactored to call
2108
2106
// handleAccessorPropertyList for each class which requires it.
2109
2107
if (ParamTy.getTypePtr ()->isPointerType () &&
2110
- Util::isSyclAccessorType (FieldTy, true /* Tmp */ ))
2108
+ Util::isSyclAccessorType (FieldTy))
2111
2109
handleAccessorType (FieldTy, RecordDecl, BS.getBeginLoc ());
2112
2110
}
2113
2111
LastParamIndex = ParamIndex;
@@ -2229,9 +2227,8 @@ class SyclKernelArgsSizeChecker : public SyclKernelFieldHandler {
2229
2227
const CXXRecordDecl *RecordDecl = FieldTy->getAsCXXRecordDecl ();
2230
2228
assert (RecordDecl && " The type must be a RecordDecl" );
2231
2229
llvm::StringLiteral MethodName =
2232
- (IsSIMD && Util::isSyclAccessorType (FieldTy, true /* Tmp*/ ))
2233
- ? InitESIMDMethodName
2234
- : InitMethodName;
2230
+ (IsSIMD && Util::isSyclAccessorType (FieldTy)) ? InitESIMDMethodName
2231
+ : InitMethodName;
2235
2232
CXXMethodDecl *InitMethod = getMethodByName (RecordDecl, MethodName);
2236
2233
assert (InitMethod && " The type must have the __init method" );
2237
2234
for (const ParmVarDecl *Param : InitMethod->parameters ())
@@ -3148,7 +3145,7 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
3148
3145
bool handleSyclSpecialType (FieldDecl *FD, QualType FieldTy) final {
3149
3146
const auto *ClassTy = FieldTy->getAsCXXRecordDecl ();
3150
3147
assert (ClassTy && " Type must be a C++ record type" );
3151
- if (Util::isSyclAccessorType (FieldTy, true /* Tmp */ )) {
3148
+ if (Util::isSyclAccessorType (FieldTy)) {
3152
3149
const auto *AccTy =
3153
3150
cast<ClassTemplateSpecializationDecl>(FieldTy->getAsRecordDecl ());
3154
3151
assert (AccTy->getTemplateArgs ().size () >= 2 &&
@@ -5209,9 +5206,9 @@ bool Util::isSyclType(QualType Ty, StringRef Name, bool Tmpl) {
5209
5206
return matchQualifiedTypeName (Ty, Scopes);
5210
5207
}
5211
5208
5212
- bool Util::isSyclAccessorType (QualType Ty, bool Tmpl ) {
5213
- return isSyclType (Ty, " accessor" , Tmpl) ||
5214
- isSyclType (Ty, " local_accessor" , Tmpl);
5209
+ bool Util::isSyclAccessorType (QualType Ty) {
5210
+ return isSyclType (Ty, " accessor" , true /* Tmpl */ ) ||
5211
+ isSyclType (Ty, " local_accessor" , true /* Tmpl */ );
5215
5212
}
5216
5213
5217
5214
bool Util::isAccessorPropertyListType (QualType Ty) {
0 commit comments