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/cppinit.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/cppinit.c')
-rw-r--r-- | gcc/cppinit.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/gcc/cppinit.c b/gcc/cppinit.c index e5011ef891b..5f10e273071 100644 --- a/gcc/cppinit.c +++ b/gcc/cppinit.c @@ -161,6 +161,12 @@ cpp_create_reader (enum c_lang lang, hash_table *table) CPP_OPTION (pfile, narrow_charset) = 0; CPP_OPTION (pfile, wide_charset) = 0; + /* A fake empty "directory" used as the starting point for files + looked up without a search path. Name cannot be '/' because we + don't want to prepend anything at all to filenames using it. All + other entries are correct zero-initialized. */ + pfile->no_search_path.name = (char *) ""; + /* Initialize the line map. Start at logical line 1, so we can use a line number of zero for special states. */ linemap_init (&pfile->line_maps); @@ -196,7 +202,7 @@ cpp_create_reader (enum c_lang lang, hash_table *table) (void *(*) (long)) xmalloc, (void (*) (void *)) free); - _cpp_init_includes (pfile); + _cpp_init_files (pfile); _cpp_init_hashtable (pfile, table); @@ -231,7 +237,7 @@ cpp_destroy (cpp_reader *pfile) obstack_free (&pfile->buffer_ob, 0); _cpp_destroy_hashtable (pfile); - _cpp_cleanup_includes (pfile); + _cpp_cleanup_files (pfile); _cpp_destroy_iconv (pfile); _cpp_free_buff (pfile->a_buff); @@ -427,15 +433,6 @@ cpp_add_dependency_target (cpp_reader *pfile, const char *target, int quote) deps_add_target (pfile->deps, target, quote); } -/* This sets up for processing input from the file FNAME. - It returns false on error. */ -bool -cpp_read_next_file (cpp_reader *pfile, const char *fname) -{ - /* Open the main input file. */ - return _cpp_read_file (pfile, fname); -} - /* This is called after options have been parsed, and partially processed. Setup for processing input from the file named FNAME, or stdin if it is the empty string. Return the original filename @@ -461,7 +458,7 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname) } pfile->line = 1; - if (!cpp_read_next_file (pfile, fname)) + if (!cpp_stack_file (pfile, fname)) return NULL; /* Set this here so the client can change the option if it wishes, |