From 50f59cd71061055cc039bbe44b5c955747719ebb Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Mon, 19 Jan 2004 21:30:18 -0800 Subject: Move cpp_reader's line_maps field to a shared global. * cpphash.h (cpp_reader): Rename line_maps field to line_table and change the type to a pointer rather than a struct. * cppinit.c (cpp_push_main_field): Adjust accordingly. * cpplib.c (do_include_common, _cpp_do_file_change, cpp_get_callbacks): Likewise. * cppfiles.c (validate_pch): Likewise. * cppmacro.c (_cpp_warn_if_unused_macro, _cpp_builtin_macro_text): Likewise. * cpperror.c (print_location): Likewise. * cpplib.h (cpp_create_reader): New line_maps pointer parameter. * cppinit.c (cpp_create_reader): Handle new parameter. (cpp_destroy): Don't free line_maps - that's no longer our job. * input.h (line_table): New variable. * toplev.c (line_table): Declare variable. (general_init): Initialize line_table. * c-opts.c (c_common_init_options): Pass line_table to cpp_create_reader. * fix-header.c (read_scan_file): New local variable line_table. Initialize, and pass it to cpp_create_reader. * Makefile.in (LIBS, LIBDEPS): Add libcpp.a. (C_AND_OBJC_OBJS, fix-header): Remove redundant libcpp.a. From-SVN: r76198 --- gcc/toplev.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/toplev.c') diff --git a/gcc/toplev.c b/gcc/toplev.c index 0a2d607..4769c82b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -189,6 +189,8 @@ const char *main_input_filename; location_t input_location; +struct line_maps line_table; + /* Nonzero if it is unsafe to create any new pseudo registers. */ int no_new_pseudos; @@ -4228,6 +4230,7 @@ general_init (const char *argv0) table. */ init_ggc (); init_stringpool (); + linemap_init (&line_table); init_ttree (); /* Initialize register usage now so switches may override. */ -- cgit v1.1