[PATCH] D16686: [OpenCL] Generate metadata for opencl_unroll_hint attribute
Xiuli PAN via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 28 18:58:16 PST 2016
pxli168 added inline comments.
================
Comment at: include/clang/Basic/DiagnosticParseKinds.td:906
@@ +905,3 @@
+def err_opencl_unroll_hint_on_non_loop : Error<
+ "OpenCL only supports opencl_unroll_hint on for, while, and do statements">;
+
----------------
you can change it to opencl_unroll_hint attribute
================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:7661
@@ -7660,1 +7660,3 @@
+def err_opencl_unroll_hint_factor : Error<
+ "opencl_unroll_hint requires a positive integral compile time constant expression">;
def err_sampler_argument_required : Error<
----------------
opencl_unroll_hint attribute
================
Comment at: lib/Sema/SemaStmtAttr.cpp:216
@@ +215,3 @@
+ if (numArgs > 1) {
+ S.Diag(A.getLoc(), diag::err_attribute_too_many_arguments) << 1;
+ return 0;
----------------
miss a test to hit this.
================
Comment at: test/Parser/opencl-unroll-hint.cl:7
@@ +6,3 @@
+ __attribute__((opencl_unroll_hint(42)))
+ if (x[0]) // expected-error {{OpenCL only supports opencl_unroll_hint on for, while, and do statements}}
+ x[0] = 15;
----------------
Seems only this is a parser check?
You should put others in test/SemaOpenCL/
http://reviews.llvm.org/D16686
More information about the cfe-commits
mailing list