[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-08 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL302411: [OpenCL] Check that global samplers are const (authored by svenvh). Changed prior to commit: https://reviews.llvm.org/D32856?vs=97959&id=98143#toc Repository: rL LLVM https://reviews.llvm.or

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks! https://reviews.llvm.org/D32856 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 97959. svenvh added a comment. Added more tests as suggested. https://reviews.llvm.org/D32856 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/SemaOpenCL/sampler_t.cl Index: test/SemaOpenCL/sampler_t.cl ===

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Sema/SemaDecl.cpp:6085 + // space qualifier or with the const qualifier. + if (DC->isTranslationUnit() && + !(R.getAddressSpace() == LangAS::opencl_constant || svenvh wrote: > yaxunl wrote: > > shou

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh marked an inline comment as done. svenvh added inline comments. Comment at: lib/Sema/SemaDecl.cpp:6085 + // space qualifier or with the const qualifier. + if (DC->isTranslationUnit() && + !(R.getAddressSpace() == LangAS::opencl_constant || --

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 97932. svenvh added a comment. Improve diagnostic text as suggested. https://reviews.llvm.org/D32856 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/SemaOpenCL/sampler_t.cl Index: test/SemaOpenCL/sampler_t.cl

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8301 +def err_opencl_sampler_qualifier : Error< + "global sampler requires a const qualifier">; def err_opencl_cast_non_zero_to_event_t : Error< global sampler requires a const

[PATCH] D32856: [OpenCL] Check that global samplers are const

2017-05-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. Patch by Simon Perretta. https://reviews.llvm.org/D32856 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/SemaOpenCL/sampler_t.cl Index: test/SemaOpenCL/sampler_t.cl ===