[gomp] parse OpenMP directives

Joseph S. Myers jsm@polyomino.org.uk
Wed Oct 13 10:49:00 GMT 2004


On Wed, 13 Oct 2004, Sebastian Pop wrote:

> The following patch registers a set of functions for parsing the
> OpenMP directives.  Most of the functions are not yet implemented, but
> I wanted to get some feed-back from the CPP people on whether this is
> the right approach for parsing the directives.

Has there been any discussion - on the main public GCC lists - of the 
design?

The approach in this patch seems reasonable in principle, but the patch 
doesn't include any of the hard parts, such as the directives involving 
expressions, and those that have effects on the handling of a subsequent 
statement and restrict its form.  I don't think at present you'll easily 
get a single directive parser working for both C and C++, though you may 
be able to unify handling after parsing.

The diagnostics in the patch do not follow the GNU Coding Standards, 
section 4.3, which describes how diagnostics are formatted.  In particular 
note:

   The string message should not begin with a capital letter when it
   follows a program name and/or file name, because that isn't the
   beginning of a sentence. (The sentence conceptually starts at the
   beginning of the line.) Also, it should not end with a period.

For this to go on mainline there should be testcases covering every 
diagnostic, every conditional in the implementation and every constraint 
in the OpenMP standard - for both C and C++ as far as the implementations 
differ.  I strongly recommend adding testcases from the beginning.  Of 
course there also need to be execution tests of all OpenMP constructs as 
well.  Similarly, maintain a section of extend.texi discussing the state 
of OpenMP support from the beginning, and update it as the support 
improves.

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    joseph@codesourcery.com (CodeSourcery mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)



More information about the Gcc-patches mailing list