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: [gomp] Parser for OpenMP directives


> 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.

There is a problem. We need to know what pragma we have got but libcpp
contains the raw string only, that's why I've used strcmp. With macro
expansion we can't even use strcmp. Maybe we should make smth like
allowed "omp pragma tokens" and "return value"?


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