diff options
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fix-header.c | 3 | ||||
-rw-r--r-- | gcc/scan-decls.c | 6 | ||||
-rw-r--r-- | gcc/scan.h | 2 |
4 files changed, 16 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6121ea7..db4ae6f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-02-14 Per Bothner <per@bothner.com> + + * fix-header.c (line_table): Move local variable in main to global. + * scan.h (line_table): Use it. + * scan-decls.c (scan_decls): Need to call linemap_lookup on token's + line (recently renamed to src_loc) before calling recognized_function. + 2004-02-14 Matt Kraai <kraai@alumni.cmu.edu> * Makefile.in: Fix comment typos. diff --git a/gcc/fix-header.c b/gcc/fix-header.c index 43916c5..67666b6 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -84,6 +84,8 @@ static void v_fatal (const char *, va_list) ATTRIBUTE_PRINTF (1,0) ATTRIBUTE_NORETURN; static void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +struct line_maps line_table; + sstring buf; int verbose = 0; @@ -590,7 +592,6 @@ read_scan_file (char *in_fname, int argc, char **argv) struct fn_decl *fn; int i, strings_processed; struct symbol_list *cur_symbols; - struct line_maps line_table; obstack_init (&scan_file_obstack); diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c index ebd69cb..70b95bf 100644 --- a/gcc/scan-decls.c +++ b/gcc/scan-decls.c @@ -165,6 +165,8 @@ scan_decls (cpp_reader *pfile, int argc ATTRIBUTE_UNUSED, { int nesting = 1; int have_arg_list = 0; + const struct line_map *map; + unsigned int line; for (;;) { token = get_a_token (pfile); @@ -182,7 +184,9 @@ scan_decls (cpp_reader *pfile, int argc ATTRIBUTE_UNUSED, || token->type == CPP_ELLIPSIS) have_arg_list = 1; } - recognized_function (&prev_id, token->line, + map = linemap_lookup (&line_table, token->src_loc); + line = SOURCE_LINE (map, token->src_loc); + recognized_function (&prev_id, line, (saw_inline ? 'I' : in_extern_C_brace || current_extern_C ? 'F' : 'f'), have_arg_list); @@ -70,3 +70,5 @@ extern int source_lineno; extern sstring source_filename; /* Current physical line number */ extern int lineno; + +extern struct line_maps line_table; |