This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: unify line number handling patch 1
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 30 Apr 2003 20:59:14 +0200
- Subject: Re: unify line number handling patch 1
- Organization: Integrable Solutions
- References: <3EB017BA.5050102@codesourcery.com>
I wanted to do this kind of lifting some time ago. Thanks for
tackling it.
Nathan Sidwell <nathan@codesourcery.com> writes:
[...]
| I couldn't simply #define lineno, as that is used in places as fieldname.
| Something had to change and I felt input_line matched the name input_filename.
I think we should just get rid of lineno and input_filename, and use a
single object. Save/Restore of "lineno, input_filename" is combersome.
[...]
| --- c-common.c 30 Apr 2003 16:21:26 -0000
| *************** c_expand_start_cond (cond, compstmt_coun
| *** 920,926 ****
| /* Record this if statement. */
| if_stack[if_stack_pointer].compstmt_count = compstmt_count;
| if_stack[if_stack_pointer].file = input_filename;
| ! if_stack[if_stack_pointer].line = lineno;
| if_stack[if_stack_pointer].needs_warning = 0;
We should just be saying
if_stack[if_stack_pointer].locus = input_locus
instead of manual componments settings.
[...]
| ! DECL_SOURCE_LINE (decl) = lineno;
| DECL_SOURCE_FILE (decl) = input_filename;
Same here
DECL_SOURCE_LOCATION (decl) = input_locus;
and so on...
-- Gaby