This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Restrict swizzle length check to OpenCL mode
ClosedPublic

Authored by bruno on Oct 12 2017, 5:55 PM.

Details

Summary

Change behavior introduced in r298369 and only error out on vector component invalid length access on OpenCL mode.

Diff Detail

Event Timeline

bruno created this revision.Oct 12 2017, 5:55 PM
Anastasia added inline comments.Oct 13 2017, 8:30 AM
test/SemaOpenCL/vector_swizzle_length.cl
7

Even though this works in Clang, ideally OpenCL vector literal is with parenthesis (see s6.1.6).

13

I am not sure it's good idea to test C mode here since this is intended for OpenCL only functionality. I think it might be better to separate C functionality and keep under regular Sema tests. We could keep the same test name to be able to identify similar functionality.

bruno marked 2 inline comments as done.Oct 13 2017, 11:45 AM
bruno added inline comments.
test/SemaOpenCL/vector_swizzle_length.cl
7

Ok. I changed this to avoid warnings in C mode. Gonna change it back,

13

Ok!

bruno updated this revision to Diff 118966.Oct 13 2017, 1:18 PM
bruno marked 2 inline comments as done.

Update patch after Anastasia's suggestions

Anastasia accepted this revision.Oct 16 2017, 4:43 AM

LGTM!

test/SemaOpenCL/vector_swizzle_length.cl
7

Can you undo this change please before committing. Thanks!

This revision is now accepted and ready to land.Oct 16 2017, 4:43 AM
This revision was automatically updated to reflect the committed changes.