[PATCH] OpenCL images and samplers related restriction (6.9.b)

Joey Gouly joey.gouly at arm.com
Thu Feb 14 05:48:33 PST 2013


Hi Guy,

Could you not merge the err_event_t_struct_field, err_image_field and
err_sampler_field errors into one?

Then code like:
+  if (LangOpts.OpenCL)
+    if (T->isImageType())
+      Diag(Loc, diag::err_image_field) << (Record->isStruct() ? 0 : 1) <<
T;
+    else if (T->isSamplerT())
+      Diag(Loc, diag::err_sampler_field) << (Record->isStruct() ? 0 : 1);
+    else if (T->isEventT())
+      Diag(Loc, diag::err_event_t_struct_field) << (Record->isStruct() ? 0
: 1);

Would become

  if (LangOpts.OpenCL && (T->isImageType() || isEventT() || isSamplerT())
    Diag(Loc, diag::err_opencl_invalid_field) << (Record->isStruct() ? 0 :
1) << T;

The same for err_image_variable, err_image_pointer, err_image_array,
err_image_return_type (and their sampler counterparts)

Just a thought,

Joey

From: cfe-commits-bounces at cs.uiuc.edu
[mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Benyei, Guy
Sent: 14 February 2013 13:26
To: Tanya Lattner; Richard Smith
Cc: cfe-commits at cs.uiuc.edu
Subject: RE: [PATCH] OpenCL images and samplers related restriction (6.9.b)

Tanya and Richard,
Thanks for the review – attached the updated patch.

Please review

Thank
      Guy








More information about the cfe-commits mailing list