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: [email protected]
[mailto:[email protected]] On Behalf Of Benyei, Guy
Sent: 14 February 2013 13:26
To: Tanya Lattner; Richard Smith
Cc: [email protected]
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





_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to