Add Sema checks for opencl type: image, pipe....
This patch is partitioned from http://reviews.llvm.org/D16047
Details
Diff Detail
Event Timeline
test/SemaOpenCL/invalid-pipes-cl2.0.cl | ||
---|---|---|
9 | Do we have a test for diagnosing pipe type for OCL < 2.0 ? |
lib/Sema/SemaDecl.cpp | ||
---|---|---|
5714 | Move to the line above, separate with -. | |
5725 | Remove 'getLangOpts().OpenCLVersion >= 200'. Parser will only allow pipe for CL2.0. Ideally we don't need to check getLangOpts().OpenCL either, but might be good to leave it for documentation purposes. However could we merge with the previous: if (getLangOpts().OpenCL) { if (...) ... // image type if (...) ... // pipe type } | |
10768 | Here you only check the pointer and not the other bits. So please modify the comment according to what the code does. Does the same restriction apply to other OpenCL types i.e. sampler, event, queue, etc? | |
test/CodeGenOpenCL/opencl_types.cl | ||
39 | Could you please not remove this mangling test as it's not being tested elsewhere. You can remove * from parameters though! |
Refine comments and diag.
lib/Sema/SemaDecl.cpp | ||
---|---|---|
5725 | Ok, it should be more clear. | |
10768 | Good suggestion. I will have a look and try to add them. | |
test/CodeGenOpenCL/opencl_types.cl | ||
39 | OK, I will try to make this mangle right for different target. | |
test/SemaOpenCL/invalid-pipes-cl2.0.cl | ||
9 | We have one called test/SemaOpenCL/pipes-1.2-negative.cl |
test/SemaOpenCL/invalid-image.cl | ||
---|---|---|
4 | Could we add similar tests for other types too. I think we could put them in existing cl files. |
test/SemaOpenCL/invalid-image.cl | ||
---|---|---|
4 | At least sampler test could go into test/SemaOpenCL/sampler_t.cl |
test/SemaOpenCL/sampler_t.cl | ||
---|---|---|
13 ↗ | (On Diff #48773) | put whitespace after , |
Move to the line above, separate with -.