aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@wolery.cumb.org>2000-06-21 18:33:51 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-06-21 18:33:51 +0000
commitc31a6508eedf17dc50388f1694bc131bd965004f (patch)
treeeb5aadb8fbe401846a1ceb69f99c1b4e7af8d929 /gcc/cpplib.c
parente3cd9945cbe33d50af459b6b4951d3dcb12a33f7 (diff)
downloadgcc-c31a6508eedf17dc50388f1694bc131bd965004f.zip
gcc-c31a6508eedf17dc50388f1694bc131bd965004f.tar.gz
gcc-c31a6508eedf17dc50388f1694bc131bd965004f.tar.bz2
cppfiles.c: Include splay-tree.h, not hashtab.h.
* cppfiles.c: Include splay-tree.h, not hashtab.h. (redundant_include_p, make_IHASH, hash_IHASH, eq_IHASH): Delete. (destroy_include_file_node): New. (_cpp_init_include_hash): Rename _cpp_init_include_table. Create a splay tree, not a hash table. (open_include_file): Look up the path in the include table, do the multiple include optimization here, etc. (cpp_included): Walk the path. (find_include_file): Just walk the path calling open_include_file, or call it directly for an absolute path. (_cpp_fake_ihash): Rename _cpp_fake_include and update for new scheme. (read_include_file): Update for new scheme. Don't close the file unless reading fails. (_cpp_execute_include, cpp_read_file): Tweak for new scheme. * cpphash.h (struct ihash, NEVER_REINCLUDE): Delete. (struct include_file): New. (NEVER_REREAD, DO_NOT_REREAD, CPP_IN_SYSTEM_HEADER): New macros. (CPP_PEDANTIC, CPP_WTRADITIONAL): Update. Update prototypes. * cppinit.c: Include splay-tree.h. (cpp_reader_init, cpp_cleanup): Update. * cpplib.h (struct cpp_buffer): Change ihash field to 'struct include_file *inc'. Remove system_header_p. (struct cpp_reader): Change all_include_files to a struct splay_tree_s *. * cpplex.c: Update all references to cpp_buffer->ihash and/or cpp_buffer->system_header_p. (cpp_pop_buffer): Close file here, only if DO_NOT_REREAD. From-SVN: r34636
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index fd98f41..3fc39dc 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -214,7 +214,7 @@ _cpp_handle_directive (pfile)
return 0;
if (CPP_PEDANTIC (pfile)
- && CPP_BUFFER (pfile)->ihash
+ && CPP_BUFFER (pfile)->inc
&& ! CPP_OPTION (pfile, preprocessed))
cpp_pedwarn (pfile, "# followed by integer");
i = T_LINE;
@@ -463,7 +463,7 @@ do_import (pfile)
U_CHAR *token;
if (CPP_OPTION (pfile, warn_import)
- && !CPP_BUFFER (pfile)->system_header_p && !pfile->import_warning)
+ && !CPP_IN_SYSTEM_HEADER (pfile) && !pfile->import_warning)
{
pfile->import_warning = 1;
cpp_warning (pfile,
@@ -508,8 +508,8 @@ do_include_next (pfile)
file like any other included source, but generate a warning. */
if (CPP_PREV_BUFFER (CPP_BUFFER (pfile)))
{
- if (CPP_BUFFER (pfile)->ihash->foundhere != ABSOLUTE_PATH)
- search_start = CPP_BUFFER (pfile)->ihash->foundhere->next;
+ if (CPP_BUFFER (pfile)->inc->foundhere)
+ search_start = CPP_BUFFER (pfile)->inc->foundhere->next;
}
else
cpp_warning (pfile, "#include_next in primary source file");
@@ -603,23 +603,23 @@ do_line (pfile)
if (action_number == 1)
{
pfile->buffer_stack_depth++;
- ip->system_header_p = 0;
+ ip->inc->sysp = 0;
read_line_number (pfile, &action_number);
}
else if (action_number == 2)
{
pfile->buffer_stack_depth--;
- ip->system_header_p = 0;
+ ip->inc->sysp = 0;
read_line_number (pfile, &action_number);
}
if (action_number == 3)
{
- ip->system_header_p = 1;
+ ip->inc->sysp = 1;
read_line_number (pfile, &action_number);
}
if (action_number == 4)
{
- ip->system_header_p = 2;
+ ip->inc->sysp = 2;
read_line_number (pfile, &action_number);
}
}
@@ -628,10 +628,10 @@ do_line (pfile)
if (strcmp ((const char *)fname, ip->nominal_fname))
{
- if (!strcmp ((const char *)fname, ip->ihash->name))
- ip->nominal_fname = ip->ihash->name;
+ if (!strcmp ((const char *)fname, ip->inc->name))
+ ip->nominal_fname = ip->inc->name;
else
- ip->nominal_fname = _cpp_fake_ihash (pfile, (const char *)fname);
+ ip->nominal_fname = _cpp_fake_include (pfile, (const char *)fname);
}
}
else if (token != CPP_VSPACE && token != CPP_EOF)
@@ -868,13 +868,13 @@ do_pragma_once (pfile)
/* Allow #pragma once in system headers, since that's not the user's
fault. */
- if (!ip->system_header_p)
+ if (!CPP_IN_SYSTEM_HEADER (pfile))
cpp_warning (pfile, "#pragma once is obsolete");
if (CPP_PREV_BUFFER (ip) == NULL)
cpp_warning (pfile, "#pragma once outside include file");
else
- ip->ihash->cmacro = NEVER_REINCLUDE;
+ ip->inc->cmacro = NEVER_REREAD;
return 1;
}
@@ -978,7 +978,7 @@ do_pragma_system_header (pfile)
if (CPP_PREV_BUFFER (ip) == NULL)
cpp_warning (pfile, "#pragma system_header outside include file");
else
- ip->system_header_p = 1;
+ ip->inc->sysp = 1;
return 1;
}