diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-29 22:26:13 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-07-29 22:26:13 +0000 |
commit | 1824e2bdf8fefbcefbe05c7555628be245d5ce4e (patch) | |
tree | 1789dbf490b4c620a39de9335b1d8002ee48603b /gcc/cpplib.c | |
parent | d0ef003fba634ebff00788588936004a650b0e70 (diff) | |
download | gcc-1824e2bdf8fefbcefbe05c7555628be245d5ce4e.tar.gz |
* Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
* cppfiles.c: Completely rewritten.
* c-incpath.c (free_path, remove_duplicates, heads, tails, add_path):
struct cpp_path is now struct cpp_dir.
(remove_duplicates): Don't simplify path names.
* c-opts.c (c_common_parse_file): cpp_read_next_file renamed
cpp_stack_file.
* cpphash.h: Include hashtab.h.
(_cpp_file): Declare.
(struct cpp_buffer): struct include_file is now struct _cpp_file,
and struct cpp_path is now struct cpp_dir. Rename members.
(struct cpp_reader): Similarly. New members once_only_files,
file_hash, file_hash_entries, quote_ignores_source_dir,
no_search_path, saw_pragma_once. Remove all_include_files and
max_include_len. Make some members bool.
(_cpp_mark_only_only): Renamed from _cpp_never_reread.
(_cpp_stack_file): Renamed from _cpp_read_file.
(_cpp_stack_include): Renamed from _cpp_execute_include.
(_cpp_init_files): Renamed from _cpp_init_includes.
(_cpp_cleanup_files): Renamed from _cpp_cleanup_includes.
* cppinit.c (cpp_create_reader): Initialize no_search_path. Update.
(cpp_read_next_file): Rename and move to cppfiles.c.
(cpp_read_main_file): Update.
* cpplib.c (run_directive): Update for renamed members.
(do_include_common, _cpp_pop_buffer): Update.
(do_import): Undeprecate #import.
(do_pragma_once): Undeprecate. Use _cpp_mark_file_once_only.
* cpplib.h: Remove file_name_map_list.
(cpp_options): Remove map_list.
(cpp_dir): Rename from cpp_path. New datatype for name_map.
(cpp_set_include_chains, cpp_stack_file, cpp_included): Update.
testsuite:
* gcc.dg/cpp/include2.c: Only expect one message.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69942 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 94fb57aeaea..505f48201c3 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -441,7 +441,7 @@ run_directive (cpp_reader *pfile, int dir_no, const char *buf, size_t count) /* from_stage3 */ true, 1); /* Disgusting hack. */ if (dir_no == T_PRAGMA) - pfile->buffer->inc = pfile->buffer->prev->inc; + pfile->buffer->file = pfile->buffer->prev->file; start_directive (pfile); /* This is a short-term fix to prevent a leading '#' being @@ -454,7 +454,7 @@ run_directive (cpp_reader *pfile, int dir_no, const char *buf, size_t count) pfile->directive->handler (pfile); end_directive (pfile, 1); if (dir_no == T_PRAGMA) - pfile->buffer->inc = NULL; + pfile->buffer->file = NULL; _cpp_pop_buffer (pfile); } @@ -684,7 +684,7 @@ do_include_common (cpp_reader *pfile, enum include_type type) pfile->cb.include (pfile, pfile->directive_line, pfile->directive->name, fname, angle_brackets); - _cpp_execute_include (pfile, fname, angle_brackets, type); + _cpp_stack_include (pfile, fname, angle_brackets, type); } free ((void *) fname); @@ -699,13 +699,6 @@ do_include (cpp_reader *pfile) static void do_import (cpp_reader *pfile) { - if (CPP_OPTION (pfile, warn_import)) - { - CPP_OPTION (pfile, warn_import) = 0; - cpp_error (pfile, DL_WARNING, - "#import is obsolete, use an #ifndef wrapper in the header file"); - } - do_include_common (pfile, IT_IMPORT); } @@ -1170,15 +1163,11 @@ do_pragma (cpp_reader *pfile) static void do_pragma_once (cpp_reader *pfile) { - if (CPP_OPTION (pfile, warn_deprecated)) - cpp_error (pfile, DL_WARNING, "#pragma once is obsolete"); - if (pfile->buffer->prev == NULL) cpp_error (pfile, DL_WARNING, "#pragma once in main file"); - else - _cpp_never_reread (pfile->buffer->inc); check_eol (pfile); + _cpp_mark_file_once_only (pfile, pfile->buffer->file, false); } /* Handle #pragma GCC poison, to poison one or more identifiers so @@ -1944,7 +1933,7 @@ void _cpp_pop_buffer (cpp_reader *pfile) { cpp_buffer *buffer = pfile->buffer; - struct include_file *inc = buffer->inc; + struct _cpp_file *inc = buffer->file; struct if_stack *ifs; /* Walk back up the conditional stack till we reach its level at |