public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Robert Dewar <dewar@gnat.com>
To: Steven Bosscher <stevenb@suse.de>
Cc: Richard Kenner <kenner@vlsi1.ultra.nyu.edu>,
	 per@bothner.com,  gcc@gcc.gnu.org
Subject: Re: Ada, treelang needs to be converted to --enable-mapped-location
Date: Thu, 07 Oct 2004 09:52:00 -0000	[thread overview]
Message-ID: <4164E743.6050802@gnat.com> (raw)
In-Reply-To: <200410070819.40053.stevenb@suse.de>

I did a bit more rummaging in the GNAT front end to see
how source locations are used, and as I rummage, more comes
to light (and to memory).

Basically an Sloc value in GNAT encodes a triple
(file-with-instantiation-history, line, column)

where line is unlimited and column is 0-32767, though
that limit on columns could trivially be increased if
necessary.

There is a strong assumption (really subsuming my
assumptions 1 and 2 in the previous note), that a
source location can be used as a direct index into
the source buffer for a given file, e.g.

    Source_Buffer (Sloc)

where Source_Buffer is a pointer to a source buffer
appropriately biased, allows direct access to the
character in the source buffer corresponding to Sloc,

This assumption is made throughout the front end, but only
in a relatively few places outside the lexical scanner. The
lexical scanner however is fundamentally dependent on this
assumption, since for example Token_Ptr, a pointer to the
current token *is* a Sloc value and that identity is assumed
througout the scanner.

Trying to abstract this out would require a lot of
source changes, and run the risk of introducing substantial
overhead into the lexical scanner, where speed is really
important.

My basic conclusion here is that trying to make any significant
change to the Sloc data structure in GNAT would be really major
work, and require substantial rewriting of the scanner.

Of course, it is still possible to do a conversion from one
form to the other in gigi, not trivial, but certainly possible.
None of my observations here speak to that possibility.

  reply	other threads:[~2004-10-07  6:50 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-07  5:07 Richard Kenner
2004-10-07  7:19 ` Steven Bosscher
2004-10-07  9:52   ` Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-10-07 19:39 Richard Kenner
2004-10-07 13:15 Richard Kenner
2004-10-07 12:57 Richard Kenner
2004-10-07 18:08 ` Mark Mitchell
2004-10-07  5:56 Richard Kenner
2004-10-07  6:24 ` Mark Mitchell
2004-10-07  8:33   ` Steven Bosscher
2004-10-07  9:03     ` Mark Mitchell
2004-10-07 10:07     ` Florian Weimer
2004-10-07 17:04       ` Daniel Jacobowitz
2004-10-08  0:35         ` Florian Weimer
2004-10-07  6:42 ` Robert Dewar
2004-10-07  6:50   ` Robert Dewar
2004-10-07 10:04   ` Laurent GUERBY
2004-10-11  7:33   ` Per Bothner
2004-10-07  0:44 Richard Kenner
2004-10-07  1:07 ` Robert Dewar
2004-10-07  1:42 ` Per Bothner
2004-10-06 23:25 Richard Kenner
2004-10-07  5:16 ` Mark Mitchell
2004-10-06 22:54 Richard Kenner
2004-10-06 23:25 ` Per Bothner
2004-10-07  1:06   ` Robert Dewar
2004-10-07  1:42     ` Per Bothner
2004-10-06 22:03 Richard Kenner
2004-10-06 22:35 ` Per Bothner
2004-10-06 17:46 Richard Kenner
2004-10-06 17:00 Richard Kenner
2004-10-06 19:11 ` Zack Weinberg
2004-10-06 13:17 Richard Kenner
2004-10-06 14:05 ` Zack Weinberg
2004-10-06 15:45   ` Geert Bosch
2004-10-06 15:52     ` Zack Weinberg
2004-10-06 16:09       ` Geert Bosch
2004-10-06 16:34         ` Zack Weinberg
2004-10-06 16:58           ` Geert Bosch
2004-10-06 18:52             ` Zack Weinberg
2004-10-06 21:58               ` Laurent GUERBY
2004-10-06 21:37 ` Per Bothner
2004-10-06 23:15   ` Joe Buck
2004-10-03  7:13 Richard Kenner
2004-10-04 11:44 ` Per Bothner
2004-09-30 11:00 Richard Kenner
2004-10-01  2:58 ` Per Bothner
2004-09-30  0:57 Richard Kenner
2004-09-30  2:09 ` Per Bothner
2004-09-30  6:58   ` James A. Morrison
2004-09-30  8:03   ` Geert Bosch
2004-09-30  8:17     ` Per Bothner
2004-09-30 17:10       ` Geert Bosch
2004-09-30 19:56         ` Per Bothner
2004-09-30 20:02           ` Geert Bosch
     [not found]             ` <415C664B.6030905@bothner.com>
2004-10-06 15:36               ` Geert Bosch
2004-09-29 23:32 Per Bothner
2004-09-30  1:27 ` Zack Weinberg
2004-09-30  1:37 ` Matt Austern
2004-09-30  5:48   ` 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=4164E743.6050802@gnat.com \
    --to=dewar@gnat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=kenner@vlsi1.ultra.nyu.edu \
    --cc=per@bothner.com \
    --cc=stevenb@suse.de \
    /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).