On Thu, Apr 11, 2013 at 07:10:46AM -0500, Aldy Hernandez wrote:
> >Yeah, the above is definitely wrong.  Just
> >   if (flag_cilkplus)
> >     cpp_register_deferred_pragma (parse_in, NULL, "simd", PRAGMA_SIMD, 
> > true, false);
> 
> Well, the thing is that you can't just use NULL for "#pragma simd"
> as a pragma and then define "#pragma simd assert" to use "simd" as a
> pragma namespace.  I had already tried that:

My understanding is that the pragma is #pragma simd, it isn't a namespace,
and assert, vectorlength etc. are clauses.
http://software.intel.com/sites/products/documentation/studio/composer/en-us/2011Update/compiler_c/cref_cls/common/cppref_pragma_simd.htm
#pragma simd [clause[ [,] clause]...]

Thus, you'd parse it as PRAGMA_SIMD, then you'd just parse all the
(optional) clauses for it.

Say for OpenMP 4.0 #pragma omp simd (which is IMHO different just by using
a non-NULL namespace).  Upon seeing PRAGMA_OMP_SIMD (in your case
PRAGMA_SIMD), the C++ parser in cp_parser_pragma just calls a function to
handle parsing of it, for PRAGMA_OMP_SIMD on gomp-4_0-branch that is
cp_parser_omp_construct (after checking that the pragma doesn't appear
outside of function context (== pragma_external).  That then just
calls cp_parser_omp_simd which uses a helper function
(cp_parser_omp_all_clauses) to parse the clauses and newline at the end
of the pragma line, then whatever else needs to be parsed after it (for
cycle nest).

        Jakub

Reply via email to