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
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
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
===
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
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 ||
--
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
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
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
===