aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-08-21 23:05:12 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-08-21 23:05:12 +0000
commitd8693c6fa425fecaf6570114f1cd69aaf3c08043 (patch)
treee9c81016bacfbc22e38372b7b5b54d1c58bf8dc2 /gcc/cpplib.c
parent5993019d2058a2d4ff24b5990ff6d4ac9c8a3311 (diff)
downloadgcc-d8693c6fa425fecaf6570114f1cd69aaf3c08043.zip
gcc-d8693c6fa425fecaf6570114f1cd69aaf3c08043.tar.gz
gcc-d8693c6fa425fecaf6570114f1cd69aaf3c08043.tar.bz2
cppfiles.c (stack_include_file): line-map.c now handles include depth.
* cppfiles.c (stack_include_file): line-map.c now handles include depth. (handle_missing_handler): Similarly. (_cpp_execute_include): Similarly. (_cpp_pop_file_buffer): Similarly. * cpphash.h (struct cpp_reader): Remove system_include_depth, buffer_stack_depth and include_depth. * cpplib.c (do_include_common): line-map.c now handles include depth. (cpp_push_buffer): Similarly. (_cpp_pop_buffer): Similarly. * cppmacro.c (builtin_macro): Update. * line-map.c (init_line_maps): Set depth. (add_line_map): Increment "used" earlier. Update and use the include depth. (trace_include): Use the include depth. * line-map.h (struct line_maps): New member depth. From-SVN: r45085
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index e02ab69..6b1c111 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -614,7 +614,7 @@ do_include_common (pfile, type)
if (!parse_include (pfile, &header))
{
/* Prevent #include recursion. */
- if (pfile->buffer_stack_depth >= CPP_STACK_MAX)
+ if (pfile->line_maps.depth >= CPP_STACK_MAX)
cpp_fatal (pfile, "#include nested too deeply");
else
{
@@ -1764,7 +1764,6 @@ cpp_push_buffer (pfile, buffer, len, type, return_at_eof)
new->pfile = pfile;
new->return_at_eof = return_at_eof;
- pfile->buffer_stack_depth++;
pfile->buffer = new;
return new;
@@ -1788,7 +1787,6 @@ _cpp_pop_buffer (pfile)
/* Update the reader's buffer before _cpp_do_file_change. */
pfile->buffer = buffer->prev;
- pfile->buffer_stack_depth--;
if (buffer->type == BUF_FILE)
{