]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fix-header.c (line_table): Move local variable in main to global.
authorPer Bothner <per@bothner.com>
Sat, 14 Feb 2004 17:40:53 +0000 (09:40 -0800)
committerPer Bothner <bothner@gcc.gnu.org>
Sat, 14 Feb 2004 17:40:53 +0000 (09:40 -0800)
* 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.

From-SVN: r77808

gcc/ChangeLog
gcc/fix-header.c
gcc/scan-decls.c
gcc/scan.h

index 6121ea73e710ed767f5fd6705d0adef4f6504b63..db4ae6f15dd3f980a26ddda54a286b4597eb24a6 100644 (file)
@@ -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.
index 43916c54789100460a8a9130792ef4a543e0a4ac..67666b6544ce6cf02b1646d3044bb892cd3d62d1 100644 (file)
@@ -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);
 
index ebd69cb05c1152a9bfc2cb53c4778ef31b756ddf..70b95bf50ae4326aa82bbb2c0decee68ced157a1 100644 (file)
@@ -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);
index 7062cdaf90ed83206e0c36b84e72655023b1ad14..0d42de5caf87dce47b4adc25e5982fa14b422c72 100644 (file)
@@ -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;