[gomp4.1] Handle new form of #pragma omp declare target

Thomas Schwinge thomas@codesourcery.com
Mon Nov 23 11:33:00 GMT 2015


Hi Jakub!

On Fri, 17 Jul 2015 15:05:59 +0200, Jakub Jelinek <jakub@redhat.com> wrote:
> [...] "omp declare target link" [...]

> This patch only marks them with the new attribute, [...]

> --- gcc/c/c-parser.c.jj	2015-07-16 18:09:25.000000000 +0200
> +++ gcc/c/c-parser.c	2015-07-17 14:11:08.553694975 +0200

>  static void
>  c_parser_omp_declare_target (c_parser *parser)
>  {
> [...]
> +  for (tree c = clauses; c; c = OMP_CLAUSE_CHAIN (c))
> +    {
> +      tree t = OMP_CLAUSE_DECL (c), id;
> +      tree at1 = lookup_attribute ("omp declare target", DECL_ATTRIBUTES (t));
> +      tree at2 = lookup_attribute ("omp declare target link",
> +				   DECL_ATTRIBUTES (t));
> +      if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_LINK)
> +	{
> +	  id = get_identifier ("omp declare target link");
> +	  std::swap (at1, at2);
> +	}
> +      else
> +	id = get_identifier ("omp declare target");

Is it intentional that you didn't add "omp declare target link" to
gcc/c-family/c-common.c:c_common_attribute_table, next to the existing
"omp declare target"?


Grüße
 Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151123/865a78f1/attachment.sig>


More information about the Gcc-patches mailing list