[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gomp-discuss] Open64's implementation of OpenMP
From: |
Pop Sébastian |
Subject: |
Re: [Gomp-discuss] Open64's implementation of OpenMP |
Date: |
Tue, 4 Feb 2003 01:20:56 +0100 |
User-agent: |
Mutt/1.4i |
On Tue, Feb 04, 2003 at 12:46:37AM +0100, Steven Bosscher wrote:
> Op ma 03-02-2003, om 23:16 schreef Diego Novillo:
> > On Mon, 03 Feb 2003, Pop Sébastian wrote:
> >
> > > So I think that here is where we will "parse" OMP pragmas arguments...
> > > Another extension will just build an equivalent tree node as
> > > for Open64's OPC_PRAGMA node.
> > >
> > > I don't think that implementing another mini-C front-end based on
> > > treelang
> > > will help our design.
> > >
> > Agreed. Once identified, adding the OMP #pragmas to GCC should
> > be fairly straightforward. I can do the initial implementation.
> > Unfortunately, I won't have much time to go over the OpenMP specs
> > for a while.
>
> It's not entirely trivial to do this, you know. GCC's implementation is
> actually very "pragma-unfriendly". All pragmas that GCC currently can
> handle are pragmas that put no restrictions on whatever syntax follows
> the pragma itself. There's no interaction between the #pragma handlers
> and the parser AFAICT.
>
c-lex handles it for us:
A simple example:
----
/* #pragma weak name [= value] */
static void
handle_pragma_weak (dummy)
cpp_reader *dummy ATTRIBUTE_UNUSED;
{
tree name, value, x, decl;
enum cpp_ttype t;
value = 0;
if (c_lex (&name) != CPP_NAME)
GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x);
if (t == CPP_EQ)
{
if (c_lex (&value) != CPP_NAME)
GCC_BAD ("malformed #pragma weak, ignored");
t = c_lex (&x);
}
if (t != CPP_EOF)
warning ("junk at end of #pragma weak");
decl = identifier_global_value (name);
if (decl && TREE_CODE_CLASS (TREE_CODE (decl)) == 'd')
{
apply_pragma_weak (decl, value);
if (value)
assemble_alias (decl, value);
}
else
pending_weaks = tree_cons (name, value, pending_weaks);
}
----
In this you see c-lex be called everytime we need a tree node representing
either the name, or value based on the lex analysis of the string in pragma.
Thus I see no reason why we couldn't have something like that for OMP.
Diego, could we keep patches for OMP in tree-ssa?
- [Gomp-discuss] Open64's implementation of OpenMP, Pop Sébastian, 2003/02/03
- Re: [Gomp-discuss] Open64's implementation of OpenMP, Diego Novillo, 2003/02/03
- Re: [Gomp-discuss] Open64's implementation of OpenMP, Biagio Lucini, 2003/02/04
- Re: [Gomp-discuss] Open64's implementation of OpenMP, Diego Novillo, 2003/02/04
- Re: [Gomp-discuss] Open64's implementation of OpenMP, Steven Bosscher, 2003/02/04