[gomp] Parser for OpenMP directives

Daniel Jacobowitz drow@false.org
Mon Mar 28 22:21:00 GMT 2005


On Mon, Mar 28, 2005 at 01:54:27PM -0800, Richard Henderson wrote:
> On Fri, Mar 25, 2005 at 11:34:53AM +0300, Dmitry Kurochkin wrote:
> > +	  if (strncmp ("omp", p, 3))
> > +	    break;
> > +	  p += 3;
> > +	  if (!ISSPACE (*p))
> > +	    break;
> > +	  ++p;
> > +	  while (*p != '\n' && ISSPACE (*p))
> > +	    ++p;
> > +	  /* This is an OpenMP pragma. Getting it's kind now. */
> 
> This is going to have to be done differently.  Note that section 2.1
> specifies that preprocessing tokens following "#pragma omp" are 
> subject to macro replacement.  Thus
> 
> #define foo barrier
> #pragma omp foo
>   
> is legal.  AFAIK, the interface currently provided by libcpp contains
> the raw text line.

You're right; but see c_register_pragma_with_expansion.

-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Gcc-patches mailing list