summaryrefslogtreecommitdiffstats
path: root/gcc/cppmacro.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-20 05:30:18 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-01-20 05:30:18 +0000
commitceec9c13cc9fd3f075d2b39ea57870268ae80a22 (patch)
tree15fcd6b635123af68ed69ca87bf633fa01f46d8e /gcc/cppmacro.c
parent088db31b1acd7821e83a135686c28ef1df3733f8 (diff)
downloadppe42-gcc-ceec9c13cc9fd3f075d2b39ea57870268ae80a22.tar.gz
ppe42-gcc-ceec9c13cc9fd3f075d2b39ea57870268ae80a22.zip
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76198 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cppmacro.c')
-rw-r--r--gcc/cppmacro.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index efae0f094e1..158d9267f36 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -80,7 +80,7 @@ _cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node,
cpp_macro *macro = node->value.macro;
if (!macro->used
- && MAIN_FILE_P (linemap_lookup (&pfile->line_maps, macro->line)))
+ && MAIN_FILE_P (linemap_lookup (pfile->line_table, macro->line)))
cpp_error_with_line (pfile, CPP_DL_WARNING, macro->line, 0,
"macro \"%s\" is not used", NODE_NAME (node));
}
@@ -136,7 +136,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
if (node->value.builtin == BT_BASE_FILE)
while (! MAIN_FILE_P (map))
- map = INCLUDED_FROM (&pfile->line_maps, map);
+ map = INCLUDED_FROM (pfile->line_table, map);
name = map->to_file;
len = strlen (name);
@@ -153,7 +153,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
/* The line map depth counts the primary source as level 1, but
historically __INCLUDE_DEPTH__ has called the primary source
level 0. */
- number = pfile->line_maps.depth - 1;
+ number = pfile->line_table->depth - 1;
break;
case BT_SPECLINE:
OpenPOWER on IntegriCloud