This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp] Parser for OpenMP directives
- From: Richard Henderson <rth at redhat dot com>
- To: Dmitry Kurochkin <dmitry dot kurochkin at gmail dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 28 Mar 2005 13:54:27 -0800
- Subject: Re: [gomp] Parser for OpenMP directives
- References: <c5742c205032500345bf44b40@mail.gmail.com>
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.
> @@ -553,6 +701,10 @@
> if (c_dialect_objc ())
> return true;
> return false;
> + case CPP_PRAGMA:
> + if (token->omp_kind == PRAGMA_OMP_THREADPRIVATE)
> + return true;
> + return false;
First, please use the -p option to (cvs) diff so that its easier to
see the context of the patch.
Second, as far as I can see, the threadprivate directive should be
handled exactly like we currently handle pragma weak. I don't see
what this pragma has to do with starting a declspec. Similarly wrt
c_parser_declaration_or_fndef.
> + case PRAGMA_OMP_CLAUSE_IF:
> + c_parser_pragma_omp_clause_if (the_parser);
> + break;
You'll need to diagnose clases that aren't allowed to be repeated.
Perhaps that's easier to do once you have an actual data structure
that you can record things in...
r~