On 11/10/2015 12:16 AM, Jakub Jelinek wrote: > On Mon, Nov 09, 2015 at 09:28:47PM -0800, Cesar Philippidis wrote: >> Here's the patch that Nathan was referring to. I ended up introducing a >> boolean variable named first in the various functions which call >> finalize_oacc_routines. The problem the original approach was having was >> that the routine clauses is only applied to the first function >> declarator in a declaration list. By using 'first', which is set to true >> if the current declarator is the first in a sequence of declarators, I >> was able to defer setting parser->oacc_routine to NULL. > > The #pragma omp declare simd has identical restrictions, but doesn't need > to add any of the first parameters to the C++ parser. > So, what are you doing differently that you need it? Handling both > differently is a consistency issue, and unnecessary additional complexity to > the parser.
I see that you added an omp_declare_simd->fndecl_seen field to cp_parser. My objective was to try and make the c++ routine parsing somewhat consistent with the c front end. I could probably add a similar oacc_routine field, but I wonder if it would be better to share omp_declare_simd. There was talk about the next version of openacc adding support for -fopenacc and -fopenmp together. So maybe there needs to be a separate oacc_routine field. Cesar