[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types
Andrew Savonichev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 27 07:22:24 PDT 2018
asavonic added a comment.
In https://reviews.llvm.org/D49723#1178127, @Anastasia wrote:
> In https://reviews.llvm.org/D49723#1174837, @asavonic wrote:
>
> > In https://reviews.llvm.org/D49723#1173352, @Anastasia wrote:
> >
> > > Btw, has this restriction been removed from CL 2.0?
> >
> >
> > No, it applies for CL2.0 as well.
>
>
> It seems however the restriction on pointer to pointer was removed (see s6.9.a last item) in CL2.0.
Right, and it seems that pointers in struct arguments should also be legal in CL2.0.
I'll submit another patch to remove this check for CL2.0.
================
Comment at: lib/Sema/SemaDecl.cpp:8187
+ // walk around RecordDecl::fields().
+ assert((PT->isArrayType() || PT->isRecordType()) && "Unexpected type.");
+ const Type *FieldRecTy = Field->getType()->getPointeeOrArrayElementType();
----------------
Anastasia wrote:
> Do we need to assert PT here too? It doesn't seem to be modified in this loop...
We should check for a field instead. Thanks!
Repository:
rC Clang
https://reviews.llvm.org/D49723
More information about the cfe-commits
mailing list