change the location_t type, DECL_SOURCE_LINE etc

Per Bothner per@bothner.com
Wed Dec 4 11:22:00 GMT 2002


Fergus Henderson wrote:
> 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).

That means that file might need to grab ceiling(600,000/(1<<14))
= 37 number of file_indexes.  There leaves still 986 available.

> The longest line is about 2300 characters.

Column numbers would probably not be very useful for generated C code.

> There are up to about 750 header files.

Perhaps file_index should be increased to 11 or 12 bits, and rline
reduced to 13 or 12 bits.  Or reduce the bits for rcolumn - it will
often just be 0 anyway.  That allows more flexibility.

In any case, it appears to me that line numbers in such C code are
useless except to debug the Mercury compiler itself.  Line numbers
relative to the C code would be useless for debugging Mercury code.
I assume you emit #line directives, in which case the size of
the C code is irrelevant.

If we start storing column numbers, I think i makes sense to disable
column numbers after a #line directive.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/



More information about the Gcc mailing list