[PATCH] [OpenCL] Promoting OpenCL image types

Joey Gouly joey.gouly at arm.com
Fri Feb 15 07:11:29 PST 2013

Hi All,

Currently the image access qualifiers (read_only, write_only and read_write)
are ignored for the OpenCL image types.

We implemented a solution by adding these access qualifiers to the
Qualifiers class that QualType uses.
However this was found to be quite a fragile approach, as there are quite a
few places inside where the
unqualified type is used and the access qualifiers are lost. Several
functions, such as: ASTContext::getCanonicalParamType,
and ASTContext::getAdjustedParameterType, had to be changed to keep the
qualifiers for OpenCL image types.

Therefore, my proposal is to promote the OpenCL image types from builtin
types, to their own type. This will allow us
to store the modifiers in the type directly.

The first patch implements this, and the second patch implements basic
support for the qualifiers.

Please review and comment!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: image_types_p2.diff
Type: application/octet-stream
Size: 8943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130215/dfae3772/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image_types_p1.diff
Type: application/octet-stream
Size: 40665 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130215/dfae3772/attachment-0001.obj>

More information about the cfe-commits mailing list