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: libcpp: registering both a pragma and a pragma namespace with the same name



> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org [mailto:gcc-patches-
> owner@gcc.gnu.org] On Behalf Of Aldy Hernandez
> Sent: Thursday, April 11, 2013 8:55 AM
> To: Jakub Jelinek
> Cc: Andrew Pinski; Tom Tromey; Iyer, Balaji V; gcc-patches
> Subject: Re: libcpp: registering both a pragma and a pragma namespace with the
> same name
> 
> On 04/11/13 07:36, Jakub Jelinek wrote:
> > 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.
> 
> Ughh, you are correct.  Sorry for the noise.
> 
> Balaji, I assume you have enough to continue?

I believe so. Thank you Jakub, Andrew and Aldy!

Sincerely,

Balaji V. Iyer.

> 
> Thanks y'all.
> Aldy
> 
> >
> > 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
> >


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