diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-06-21 18:33:51 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-06-21 18:33:51 +0000 |
commit | c31a6508eedf17dc50388f1694bc131bd965004f (patch) | |
tree | eb5aadb8fbe401846a1ceb69f99c1b4e7af8d929 /gcc/cppinit.c | |
parent | e3cd9945cbe33d50af459b6b4951d3dcb12a33f7 (diff) | |
download | gcc-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/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index 86f85d6..e21c566 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -22,6 +22,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" #include "hashtab.h" +#include "splay-tree.h" #include "cpplib.h" #include "cpphash.h" #include "output.h" @@ -551,7 +552,7 @@ cpp_reader_init (pfile) (struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending)); _cpp_init_macro_hash (pfile); - _cpp_init_include_hash (pfile); + _cpp_init_include_table (pfile); } /* Initialize a cpp_printer structure. As a side effect, open the @@ -605,7 +606,7 @@ cpp_cleanup (pfile) deps_free (pfile->deps); htab_delete (pfile->hashtab); - htab_delete (pfile->all_include_files); + splay_tree_delete (pfile->all_include_files); } |