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: [PATCH] New pragma handling mechanism.


Richard Henderson wrote:
On Tue, Apr 12, 2005 at 04:40:09PM -0700, Mark Mitchell wrote:

I'd really like to avoid the pragma handlers seeing subsequent file content.


Ok, then what do you suggest for handling the rather tight coupling
of open mp pragmas with the immediately succeeding statement?

I tried to explain what I had in mind here:


http://gcc.gnu.org/ml/gcc-patches/2005-04/msg00934.html

but, obviously, it was either unclear or not compelling.

If you give me a hint as to which, I'll try to rectify the problem. :-) (Though, as I'm off email again tomorrow, I might be a bit slow to do so.)

The key idea is that the parser would, prior to parsing a statement, or perhaps after, if more convenient, ask "are there any #pragmas that apply to this statement?", and then take appropriate action.

Certainly, if you do this before the statement, there is nothing that the parser cannot do that the #pragma handler could do. However, the additional structure might allow the parser to do things the handler cannot easily do -- like, in a C++ template, squirrel away the #pragma until instantiation time. I know it's possible to implement OpenMP using such a system, in that I have seen a worked example.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304


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