[PATCH] Error on illegal OpenCL kernel argument types

Richard Smith richard at metafoo.co.uk
Fri Jul 19 15:56:01 PDT 2013


  Couple of minor tweaks, then LGTM


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6463-6464
@@ -6459,1 +6462,4 @@
+  "within field of type %0 declared here">;
+def note_illegal_field_declared_here : Note<
+  "field of illegal %0type %1 declared here">;
 def err_event_t_global_var : Error<
----------------
Please use a %select in the place of %0 here (we try to keep our diagnostics translatable, even though we don't support localization yet).

================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:6459-6460
@@ +6458,4 @@
+  "%0 cannot be used as the type of a kernel parameter">;
+def err_record_with_pointers_kernel_param : Error<
+  "%select{struct|union}0 kernel parameters may not contain OpenCL objects">;
+def note_within_field_of_type : Note<
----------------
"may not contain OpenCL objects" doesn't seem appropriate here. "may not contain pointers" seems to match the cases where this diagnostic is emitted.


http://llvm-reviews.chandlerc.com/D1052



More information about the cfe-commits mailing list