This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Prohibit using reserve_id_t in program scope.
ClosedPublic

Authored by echuraev on Nov 24 2016, 5:48 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

echuraev updated this revision to Diff 79226.Nov 24 2016, 5:48 AM
echuraev retitled this revision from to [OpenCL] Prohibit using reserve_id_t in program scope..
echuraev updated this object.
echuraev added a reviewer: Anastasia.
echuraev added subscribers: bader, yaxunl, cfe-commits.
Anastasia edited edge metadata.Nov 24 2016, 10:57 AM

Btw, Spec v2.0 s6.9.p seems to mention other types as well!

lib/Sema/SemaDecl.cpp
5923 ↗(On Diff #79226)
  • Could we combine with the OpenCL check above?

I see that we already have many more scattered all over in this functions. Perhaps some cleanup would be nice at some point. :)

  • Also not sure whether return nullptr;

is needed?

  • Could you add a reference to the Spec section too.
test/SemaOpenCL/invalid-pipes-cl2.0.cl
3 ↗(On Diff #79226)

Variable names appear inconsistent with the rest. :)

27 ↗(On Diff #79226)

this seems to be tested in test/SemaOpenCL/access-qualifier.cl

echuraev updated this revision to Diff 79292.Nov 25 2016, 3:30 AM
echuraev edited edge metadata.
echuraev marked 3 inline comments as done.
Anastasia added inline comments.Nov 25 2016, 9:41 AM
lib/Sema/SemaDecl.cpp
5924 ↗(On Diff #79292)

The format is typically:
OpenCL v1.2 s6.9.r

5926 ↗(On Diff #79292)

This line looks inconsistent with above! Put ":" after OpenCL v2.0 s6.9.q.

Also formatting seems off. At least the line width.

echuraev updated this revision to Diff 79372.Nov 27 2016, 10:22 PM
echuraev marked 2 inline comments as done.
Anastasia accepted this revision.Nov 28 2016, 7:26 AM
Anastasia edited edge metadata.

LGTM! Thanks! Please, address the small nitpick before committing.

lib/Sema/SemaDecl.cpp
5965 ↗(On Diff #79372)

OpenCL 1.2 spec, p6.9 r -> OpenCL v1.2 s6.9.r

This revision is now accepted and ready to land.Nov 28 2016, 7:26 AM
echuraev updated this revision to Diff 79508.Nov 28 2016, 9:09 PM
echuraev edited edge metadata.
This revision was automatically updated to reflect the committed changes.