From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17879 invoked by alias); 4 Dec 2002 02:36:32 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 17660 invoked from network); 4 Dec 2002 02:36:29 -0000 Received: from unknown (HELO fencepost.gnu.org) (199.232.76.164) by sources.redhat.com with SMTP; 4 Dec 2002 02:36:29 -0000 Received: from monty-python.gnu.org ([199.232.76.173]) by fencepost.gnu.org with esmtp (Exim 4.10) id 18JPOm-00044R-00 for gcc@gnu.org; Tue, 03 Dec 2002 21:36:28 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18JPOQ-0003tV-00 for gcc@gnu.org; Tue, 03 Dec 2002 21:36:08 -0500 Received: from mulga.cs.mu.oz.au ([128.250.1.22]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18JPOP-0003bv-00 for gcc@gnu.org; Tue, 03 Dec 2002 21:36:06 -0500 Received: from hg.cs.mu.oz.au (hg.cs.mu.OZ.AU [128.250.25.19]) by mulga.cs.mu.OZ.AU with ESMTP id NAA24843; Wed, 4 Dec 2002 13:35:57 +1100 (EST) Received: (from fjh@localhost) by hg.cs.mu.oz.au (8.10.2/8.10.2/SuSE Linux 8.10.0-0.3) id gB42Zum07791; Wed, 4 Dec 2002 13:35:56 +1100 Date: Tue, 03 Dec 2002 18:36:00 -0000 From: Fergus Henderson To: Per Bothner Cc: gcc@gnu.org Subject: Re: change the location_t type, DECL_SOURCE_LINE etc Message-ID: <20021204133556.A32354@hg.cs.mu.oz.au> References: <3DEBED4D.5070106@bothner.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3DEBED4D.5070106@bothner.com>; from per@bothner.com on Mon, Dec 02, 2002 at 03:31:25PM -0800 X-Spam-Status: No, hits=-16.0 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES, SIGNATURE_SHORT_DENSE,SPAM_PHRASE_00_01,USER_AGENT, USER_AGENT_MUTT version=2.41 X-Spam-Level: X-SW-Source: 2002-12/txt/msg00156.txt.bz2 On 02-Dec-2002, Per Bothner wrote: > To reduce space usage we have to replace the filename by an index > in a 'line_table'. We also have to use bit fields in order to squeeze > everything into 32 bits. This means a limited number of different > file names, and a limited range on line and column numbers. However, > it is not quite a limited as the 14 and 8 suggest, since we can > have multiple 'line_table' entries for the same filename, but with > different line and column base values. Thus: > > /* The data structure used to record a location in a translation unit. */ > struct location_s GTY (()) > { > /* An index into line_table. */ > unsigned int file_index : 10; > > /* The source line, relative to line_table[file_index].line_base. */ > unsigned int rline : 14; > > /* The source column, relative to line_table[file_index].column_base. */ > unsigned int rcolumn : 8; > }; The C code generated by the Mercury compiler is going to overflow those limits, I think. Currently the longest C file generated by the Mercury compiler is about 600,000 lines long (20,000,000 bytes). The longest line is about 2300 characters. There are up to about 750 header files. -- Fergus Henderson | "I have always known that the pursuit The University of Melbourne | of excellence is a lethal habit" WWW: | -- the last words of T. S. Garp.