diff options
Diffstat (limited to 'gcc/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index f50bcc1f..c60db8b 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -21,8 +21,6 @@ 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" @@ -225,7 +223,6 @@ static int opt_comp PARAMS ((const void *, const void *)); #endif static int parse_option PARAMS ((const char *)); static int handle_option PARAMS ((cpp_reader *, int, char **)); -static int report_missing_guard PARAMS ((splay_tree_node, void *)); /* Fourth argument to append_include_chain: chain to use */ enum { QUOTE = 0, BRACKET, SYSTEM, AFTER }; @@ -533,8 +530,9 @@ cpp_reader_init (pfile) CPP_OPTION (pfile, pending) = (struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending)); - _cpp_init_macro_hash (pfile); - _cpp_init_include_table (pfile); + _cpp_init_stacks (pfile); + _cpp_init_macros (pfile); + _cpp_init_includes (pfile); } /* Initialize a cpp_printer structure. As a side effect, open the @@ -580,8 +578,9 @@ cpp_cleanup (pfile) if (pfile->deps) deps_free (pfile->deps); - htab_delete (pfile->hashtab); - splay_tree_delete (pfile->all_include_files); + _cpp_cleanup_stacks (pfile); + _cpp_cleanup_macros (pfile); + _cpp_cleanup_includes (pfile); _cpp_free_temp_tokens (pfile); } @@ -1009,27 +1008,6 @@ cpp_start_read (pfile, print, fname) return 1; } -static int -report_missing_guard (n, b) - splay_tree_node n; - void *b; -{ - struct include_file *f = (struct include_file *) n->value; - int *bannerp = (int *)b; - - if (f && f->cmacro == 0 && f->include_count == 1) - { - if (*bannerp == 0) - { - fputs (_("Multiple include guards may be useful for:\n"), stderr); - *bannerp = 1; - } - fputs (f->name, stderr); - putc ('\n', stderr); - } - return 0; -} - /* This is called at the end of preprocessing. It pops the last buffer and writes dependency output. It should also clear macro definitions, such that you could call cpp_start_read @@ -1085,11 +1063,7 @@ cpp_finish (pfile, print) /* Report on headers that could use multiple include guards. */ if (CPP_OPTION (pfile, print_include_names)) - { - int banner = 0; - splay_tree_foreach (pfile->all_include_files, report_missing_guard, - (void *) &banner); - } + _cpp_report_missing_guards (pfile); } static void |