public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Matt Austern <austern@apple.com>
To: Zack Weinberg <zack@codesourcery.com>
Cc: gcc@gcc.gnu.org, Per Bothner <per@bothner.com>,
	"Joseph S. Myers" <jsm@polyomino.org.uk>
Subject: Re: #pragma interface/implementation broken if --enable-mapped-location
Date: Wed, 29 Sep 2004 21:57:00 -0000	[thread overview]
Message-ID: <837EF2C2-1247-11D9-AE93-000393B2ABA2@apple.com> (raw)
In-Reply-To: <87acv9t012.fsf@codesourcery.com>

On Sep 29, 2004, at 11:14 AM, Zack Weinberg wrote:

> Per Bothner <per@bothner.com> writes:
>
>> Zack Weinberg wrote:
>>
>>> Given all that, I think it makes sense for all pragmas to become
>>> token sequences.
>>
>> How close are we to having this?
>>
>> I'm hoping to check in today my gcc/java changes to handle
>> --enable-mapped-location.  That would allow bootstrapping gcc
>> with the default set of languages.  But that requires a fix
>> or workaround for the #pragma interface/implementation bug,
>> since otherwise libjava won't build.
>>
>> If we're not close to the #pragma-as-token change, I could
>> implement a quickie fix to for example temporarily clear
>> cb.line_change during cpp_handle_deferred_pragma.
>
> I think we're at least a couple weeks away from #pragma-as-tokens.  A
> quickie fix would be fine by me.

The reason I didn't implement pragma-as-tokens was pretty simple:
I thought it would involve fairly tricky changes in both libcpp and
the front end.

First, the libcpp changes: it's easy to get libcpp to do parsing
the same way it normally does but using a different source of
characters; the infrastructure is already there.  I didn't see an
easy way of getting the pragma handlers to use an alternate
mechanism for getting tokens.  There is no such infrastructure in
the existing libcpp, and creating something new, just for this
purpose, didn't seem worth it.

Second, the front end changes.  If a pragma is a single token,
then it's very easy for the front end to skip past it and to
only evaluate it once.  If it's a stream of tokens, then it's
harder.  (But possibly that concern is no longer valid now that
Zack made the changes so that pragmas may only appear in specific
places.)

I still find pragmas-as-strings simpler and more elegant than
pragmas-as-tokens, and I don't quite understand why it's
necessary to move to pragmas-as-tokens to fix #pragma interface/
implementation in the presence of --enable-mapped-location.  But
if other people think this change is a good idea, I'm not going
to stand in the way.

			--Matt

  reply	other threads:[~2004-09-29 18:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-24  2:08 Per Bothner
2004-09-24  2:22 ` Zack Weinberg
2004-09-24  2:43   ` Per Bothner
2004-09-24  4:58     ` Zack Weinberg
2004-09-24 14:17       ` Joseph S. Myers
2004-09-24 21:47         ` Zack Weinberg
2004-09-24 22:15           ` Joseph S. Myers
2004-09-24 22:34             ` Zack Weinberg
2004-09-29 19:24           ` Per Bothner
2004-09-29 20:56             ` Zack Weinberg
2004-09-29 21:57               ` Matt Austern [this message]
2004-09-29 22:50                 ` Zack Weinberg
2004-09-30  7:57               ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837EF2C2-1247-11D9-AE93-000393B2ABA2@apple.com \
    --to=austern@apple.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jsm@polyomino.org.uk \
    --cc=per@bothner.com \
    --cc=zack@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).