aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.co.uk>2003-07-29 22:26:13 +0000
committerNeil Booth <neil@gcc.gnu.org>2003-07-29 22:26:13 +0000
commit8f9b40094d6e960d965e632f6537bf6eaa980ab5 (patch)
tree1789dbf490b4c620a39de9335b1d8002ee48603b /gcc/cpphash.h
parentad96995ba1e08da3646502930168ea0c39a89ad7 (diff)
downloadgcc-8f9b40094d6e960d965e632f6537bf6eaa980ab5.zip
gcc-8f9b40094d6e960d965e632f6537bf6eaa980ab5.tar.gz
gcc-8f9b40094d6e960d965e632f6537bf6eaa980ab5.tar.bz2
Makefile.in (LIBCPP_DEPS): Add HASHTAB_H.
* 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. From-SVN: r69942
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index f814b9f..e4378cb 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -24,6 +24,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#define GCC_CPPHASH_H
#include "hashtable.h"
+#include "hashtab.h"
#ifdef HAVE_ICONV
#include <iconv.h>
@@ -36,6 +37,7 @@ struct directive; /* Deliberately incomplete. */
struct pending_option;
struct op;
struct strbuf;
+struct _cpp_file;
typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t,
struct strbuf *);
@@ -281,9 +283,9 @@ struct cpp_buffer
struct cpp_buffer *prev;
- /* Pointer into the include table; non-NULL if this is a file
- buffer. Used for include_next and to record control macros. */
- struct include_file *inc;
+ /* Pointer into the file table; non-NULL if this is a file buffer.
+ Used for include_next and to record control macros. */
+ struct _cpp_file *file;
/* Value of if_stack at start of this file.
Used to prohibit unmatched #endif (etc) in an include file. */
@@ -314,7 +316,7 @@ struct cpp_buffer
/* 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 cpp_path dir;
+ struct cpp_dir dir;
/* Used for buffer overlays by cpptrad.c. */
const uchar *saved_cur, *saved_rlimit;
@@ -355,8 +357,24 @@ struct cpp_reader
const struct directive *directive;
/* Search paths for include files. */
- struct cpp_path *quote_include; /* "" */
- struct cpp_path *bracket_include; /* <> */
+ struct cpp_dir *quote_include; /* "" */
+ struct cpp_dir *bracket_include; /* <> */
+ struct cpp_dir no_search_path; /* No path. */
+
+ /* Chain of files that were #import-ed or contain #pragma once. */
+ struct _cpp_file *once_only_files;
+
+ /* File and directory hash table. */
+ htab_t file_hash;
+ struct file_hash_entry *file_hash_entries;
+ unsigned int file_hash_entries_allocated, file_hash_entries_used;
+
+ /* Nonzero means don't look for #include "foo" the source-file
+ directory. */
+ bool quote_ignores_source_dir;
+
+ /* Non-zero if any file has contained #pragma once. */
+ bool saw_pragma_once;
/* Multiple include optimization. */
const cpp_hashnode *mi_cmacro;
@@ -386,13 +404,6 @@ struct cpp_reader
wide execution character set. */
struct cset_converter wide_cset_desc;
- /* Tree of other included files. See cppfiles.c. */
- struct splay_tree_s *all_include_files;
-
- /* 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;
-
/* Date and time text. Calculated together if either is requested. */
const uchar *date;
const uchar *time;
@@ -432,12 +443,8 @@ struct cpp_reader
preprocessor. */
struct spec_nodes spec_nodes;
- /* Nonzero means don't look for #include "foo" the source-file
- directory. */
- unsigned char quote_ignores_source_dir;
-
/* Whether cpplib owns the hashtable. */
- unsigned char our_hashtable;
+ bool our_hashtable;
/* Traditional preprocessing output buffer (a logical line). */
struct
@@ -509,16 +516,16 @@ extern void _cpp_init_hashtable (cpp_reader *, hash_table *);
extern void _cpp_destroy_hashtable (cpp_reader *);
/* In cppfiles.c */
+extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *, bool);
extern void _cpp_fake_include (cpp_reader *, const char *);
-extern void _cpp_never_reread (struct include_file *);
-extern bool _cpp_read_file (cpp_reader *, const char *);
-extern bool _cpp_execute_include (cpp_reader *, const char *, int,
- enum include_type);
+extern bool _cpp_stack_file (cpp_reader *, const char *);
+extern bool _cpp_stack_include (cpp_reader *, const char *, int,
+ enum include_type);
extern int _cpp_compare_file_date (cpp_reader *, const char *, int);
extern void _cpp_report_missing_guards (cpp_reader *);
-extern void _cpp_init_includes (cpp_reader *);
-extern void _cpp_cleanup_includes (cpp_reader *);
-extern void _cpp_pop_file_buffer (cpp_reader *, struct include_file *);
+extern void _cpp_init_files (cpp_reader *);
+extern void _cpp_cleanup_files (cpp_reader *);
+extern void _cpp_pop_file_buffer (cpp_reader *, struct _cpp_file *);
/* In cppexp.c */
extern bool _cpp_parse_expr (cpp_reader *);