This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Rework C/C++ OpenACC routine parsing (was: C/C++: Simplify handling of location information for OpenACC routine directives)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]