aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-03-02 07:35:12 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-03-02 07:35:12 +0000
commit591e15a110886aa13f6b54fe4d0ab5a8a8bf8574 (patch)
treeae411edfe1a33d4c87567b4c5791c4fa1ec59310 /gcc/cpphash.h
parentc04278f74fd6b49f7a770ae51fd1dd0412989af7 (diff)
downloadgcc-591e15a110886aa13f6b54fe4d0ab5a8a8bf8574.zip
gcc-591e15a110886aa13f6b54fe4d0ab5a8a8bf8574.tar.gz
gcc-591e15a110886aa13f6b54fe4d0ab5a8a8bf8574.tar.bz2
cppfiles.c (struct include_file): Update.
* cppfiles.c (struct include_file): Update. (stack_include_file): Use search_from. (cpp_included, find_include_file): Update. (cpp_execute_include): Update. ptr->name may not be null terminated. Use the new search_from member variable of cpp_buffer. (_cpp_compare_file_date): Similarly. (search_from): New function, similiar to actual_directory. (actual_directory): Delete. (remap_filename): Update. loc->name may not be null terminated. (struct file_name_list): Rename search_path. Update. * cpphash.h (struct cpp_buffer): Delete actual_dir. New members search_from and dir. (struct cpp_reader): Remove actual_dirs. * cppinit.c (struct cpp_pending): Update for renamed objects. (append_include_chain, remove_dup_dir, remove_dup_dirs, merge_include_chains, cpp_destroy, cpp_start_read): Similarly. * cpplib.h (struct cpp_options): Similarly. From-SVN: r40178
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h40
1 files changed, 21 insertions, 19 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 14df2da..5b2c24b 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -72,23 +72,23 @@ struct cpp_pool
unsigned int locks;
};
-/* List of directories to look for include files in. */
-struct file_name_list
+/* List of directories to look for include files in. */
+struct search_path
{
- struct file_name_list *next;
- struct file_name_list *alloc; /* for the cache of
- current directory entries */
- char *name;
- unsigned int nlen;
+ struct search_path *next;
+
+ /* NOTE: NAME may not be null terminated for the case of the current
+ file's directory! */
+ const char *name;
+ unsigned int len;
/* We use these to tell if the directory mentioned here is a duplicate
- of an earlier directory on the search path. */
+ of an earlier directory on the search path. */
ino_t ino;
dev_t dev;
- /* If the following is nonzero, it is a C-language system include
- directory. */
+ /* Non-zero if it is a system include directory. */
int sysp;
- /* Mapping of file names for this directory.
- Only used on MS-DOS and related platforms. */
+ /* Mapping of file names for this directory. Only used on MS-DOS
+ and related platforms. */
struct file_name_map *name_map;
};
@@ -180,9 +180,6 @@ struct cpp_buffer
/* Filename specified with #line command. */
const char *nominal_fname;
- /* Actual directory of this file, used only for "" includes */
- struct file_name_list *actual_dir;
-
/* Pointer into the include table. Used for include_next and
to record control macros. */
struct include_file *inc;
@@ -227,6 +224,15 @@ struct cpp_buffer
/* Buffer type. */
ENUM_BITFIELD (cpp_buffer_type) type : 8;
+
+ /* The directory of the this buffer's file. Its NAME member is not
+ allocated, so we don't need to worry about freeing it. */
+ struct search_path dir;
+
+ /* The directory to start searching for "" include files. Is either
+ "dir" above, or options.quote_include, depending upon whether -I-
+ was on the command line. */
+ struct search_path *search_from;
};
/* A cpp_reader encapsulates the "state" of a pre-processor run.
@@ -297,10 +303,6 @@ struct cpp_reader
/* Tree of other included files. See cppfiles.c. */
struct splay_tree_s *all_include_files;
- /* Chain of `actual directory' file_name_list entries, for ""
- inclusion. */
- struct file_name_list *actual_dirs;
-
/* Current maximum length of directory names in the search path
for include files. (Altered as we get more of them.) */
unsigned int max_include_len;