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/c-incpath.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/c-incpath.c')
-rw-r--r-- | gcc/c-incpath.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c index 6ec42cc0bfd..e28114652a3 100644 --- a/gcc/c-incpath.c +++ b/gcc/c-incpath.c @@ -45,21 +45,21 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static void add_env_var_paths (const char *, int); static void add_standard_paths (const char *, const char *, int); -static void free_path (struct cpp_path *, int); +static void free_path (struct cpp_dir *, int); static void merge_include_chains (cpp_reader *, int); -static struct cpp_path *remove_duplicates (cpp_reader *, struct cpp_path *, - struct cpp_path *, - struct cpp_path *, int); +static struct cpp_dir *remove_duplicates (cpp_reader *, struct cpp_dir *, + struct cpp_dir *, + struct cpp_dir *, int); /* Include chains heads and tails. */ -static struct cpp_path *heads[4]; -static struct cpp_path *tails[4]; +static struct cpp_dir *heads[4]; +static struct cpp_dir *tails[4]; static bool quote_ignores_source_dir; enum { REASON_QUIET = 0, REASON_NOENT, REASON_DUP, REASON_DUP_SYS }; /* Free an element of the include chain, possibly giving a reason. */ static void -free_path (struct cpp_path *path, int reason) +free_path (struct cpp_dir *path, int reason) { switch (reason) { @@ -169,12 +169,12 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc) JOIN, unless it duplicates JOIN in which case the last path is removed. Return the head of the resulting chain. Any of HEAD, JOIN and SYSTEM can be NULL. */ -static struct cpp_path * -remove_duplicates (cpp_reader *pfile, struct cpp_path *head, - struct cpp_path *system, struct cpp_path *join, +static struct cpp_dir * +remove_duplicates (cpp_reader *pfile, struct cpp_dir *head, + struct cpp_dir *system, struct cpp_dir *join, int verbose) { - struct cpp_path **pcur, *tmp, *cur; + struct cpp_dir **pcur, *tmp, *cur; struct stat st; for (pcur = &head; *pcur; ) @@ -182,7 +182,6 @@ remove_duplicates (cpp_reader *pfile, struct cpp_path *head, int reason = REASON_QUIET; cur = *pcur; - cpp_simplify_path (cur->name); if (stat (cur->name, &st)) { @@ -269,7 +268,7 @@ merge_include_chains (cpp_reader *pfile, int verbose) /* If verbose, print the list of dirs to search. */ if (verbose) { - struct cpp_path *p; + struct cpp_dir *p; fprintf (stderr, _("#include \"...\" search starts here:\n")); for (p = heads[QUOTE];; p = p->next) @@ -304,9 +303,9 @@ split_quote_chain (void) void add_path (char *path, int chain, int cxx_aware) { - struct cpp_path *p; + struct cpp_dir *p; - p = xmalloc (sizeof (struct cpp_path)); + p = xmalloc (sizeof (struct cpp_dir)); p->next = NULL; p->name = path; if (chain == SYSTEM || chain == AFTER) |