This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Rework C/C++ OpenACC routine parsing (was: C/C++: Simplify handling of location information for OpenACC routine directives)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 Jul 2016 16:22:18 +0200
- Subject: Re: Rework C/C++ OpenACC routine parsing (was: C/C++: Simplify handling of location information for OpenACC routine directives)
- Authentication-results: sourceware.org; auth=none
- References: <87poqhnb39.fsf@hertz.schwinge.homeip.net> <87k2gpmxwo.fsf@hertz.schwinge.homeip.net>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Wed, Jul 13, 2016 at 04:10:31PM +0200, Thomas Schwinge wrote:
> @@ -14029,29 +14032,32 @@ c_parser_oacc_kernels_parallel (location_t loc, c_parser *parser,
> static void
> c_parser_oacc_routine (c_parser *parser, enum pragma_context context)
> {
> - tree decl = NULL_TREE;
> + gcc_checking_assert (context == pragma_external);
> +
> oacc_routine_data data;
> + data.error_seen = false;
> + data.fndecl_seen = false;
> data.clauses = NULL_TREE;
> data.loc = c_parser_peek_token (parser)->location;
> -
> - if (context != pragma_external)
> - c_parser_error (parser, "%<#pragma acc routine%> not at file scope");
>
> c_parser_consume_pragma (parser);
>
> - /* Scan for optional '( name )'. */
> + /* Look for optional '( name )'. */
> if (c_parser_peek_token (parser)->type == CPP_OPEN_PAREN)
Can you please change this to
if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
?
Ok for trunk with that change.
Jakub