Skip to content

Commit a350e20

Browse files
committed
Fix typos
Signed-off-by: Dmitry Sidorov <dmitry.sidorov@intel.com>
1 parent 819a973 commit a350e20

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class Util {
8181
static bool isSyclHalfType(const QualType &Ty);
8282

8383
/// Checks whether given clang type is a full specialization of the SYCL
84-
/// property_list class.
84+
/// buffer_location class.
8585
static bool isSyclBufferLocation(const QualType &Ty);
8686

8787
/// Checks whether given clang type is a standard SYCL API class with given
@@ -1335,8 +1335,16 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
13351335
// Don't do -1 here because we count on this to be the first parameter added
13361336
// (if any).
13371337
size_t ParamIndex = Params.size();
1338-
for (const ParmVarDecl *Param : InitMethod->parameters())
1339-
addParam(BS, Param->getType().getCanonicalType(), 42);
1338+
auto ParamIt = InitMethod->parameters().begin();
1339+
if (*ParamIt) {
1340+
// Add meaningful argument (not '-1') to buffer_location attribute only
1341+
// for an accessor pointer
1342+
size_t BufferLocAttrArg = handleBufferLocationProperty(FieldTy);
1343+
addParam(BS, (*ParamIt)->getType().getCanonicalType(), BufferLocAttrArg);
1344+
++ParamIt;
1345+
for (; ParamIt != InitMethod->parameters().end(); ++ParamIt)
1346+
addParam(BS, (*ParamIt)->getType().getCanonicalType(), -1);
1347+
}
13401348
LastParamIndex = ParamIndex;
13411349
return true;
13421350
}

0 commit comments

Comments
 (0)