[OpenCL] __generic address space for CL2.0
Anastasia Stulova
anastasia.stulova at arm.com
Mon Nov 17 10:21:17 PST 2014
Hi Aaron,
Thanks for your comments! All issues are addressed in the attached update!
-----Original Message-----
From: aaron.ballman at gmail.com [mailto:aaron.ballman at gmail.com] On Behalf Of Aaron Ballman
> These could be combined with a %select.
I had to add a bit of extra code for this to work. Does it seem reasonable to you?
Thanks,
Anastasia
-----Original Message-----
From: aaron.ballman at gmail.com [mailto:aaron.ballman at gmail.com] On Behalf Of Aaron Ballman
Sent: 12 November 2014 13:09
To: Anastasia Stulova
Cc: llvm cfe
Subject: Re: [OpenCL] __generic address space for CL2.0
On Mon, Nov 10, 2014 at 12:53 PM, Anastasia Stulova <anastasia.stulova at arm.com> wrote:
> This patch adds parsing of __generic as a keyword and extends Clang
> address spaces with generic one.
> diff --git a/include/clang/Basic/Attr.td b/include/clang/Basic/Attr.td
> index 51837fe..a90bfaa 100644
> --- a/include/clang/Basic/Attr.td
> +++ b/include/clang/Basic/Attr.td
> @@ -640,6 +640,11 @@ def OpenCLConstantAddressSpace : TypeAttr {
> let Documentation = [Undocumented]; }
>
> +def OpenCLGenericAddressSpace : TypeAttr {
> + let Spellings = [Keyword<"__generic">, Keyword<"generic">];
> + let Documentation = [Undocumented]; }
No new undocumented attributes, please. :-)
> diff --git a/include/clang/Basic/DiagnosticParseKinds.td
> b/include/clang/Basic/DiagnosticParseKinds.td
> index 90d30d7..1087a22 100644
> --- a/include/clang/Basic/DiagnosticParseKinds.td
> +++ b/include/clang/Basic/DiagnosticParseKinds.td
> @@ -932,6 +932,8 @@ def err_pragma_optimize_extra_argument : Error<
> // OpenCL Section 6.8.g def err_not_opencl_storage_class_specifier :
> Error<
> "OpenCL does not support the '%0' storage class specifier">;
> +def err_opencl_unknown_type_specifier : Error<
> + "OpenCL does not support the '%0' type qualifier">;
These could be combined with a %select.
> --- /dev/null
> +++ b/test/Parser/opencl-cl20.cl
> @@ -0,0 +1,5 @@
> +// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL2.0
> +// expected-no-diagnostics
> +
> +void __generic_test(__generic int *g) {} void generic_test(generic
> +int *g) {}
>
You are missing a test case that exercises the new diagnostic you've added. Also, since this attribute can go on any type, does it make sense to place it on a function type, or other parsing contexts?
Thanks!
~Aaron
>
>
>
> A basic parsing test is included in this patch.
>
>
>
> Looking forward to your feedback,
>
> Anastasia
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: generic_keyword_v1.patch
Type: application/octet-stream
Size: 17145 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141117/dc32823e/attachment.obj>
More information about the cfe-commits
mailing list