OSDN Git Service

Fix for aliasing problem reported by Michael Matz.
[pf3gnuchains/gcc-fork.git] / gcc / cpphash.h
index e4378cb..734d3bb 100644 (file)
@@ -24,7 +24,6 @@ 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,11 +35,10 @@ typedef int iconv_t;  /* dummy */
 struct directive;              /* Deliberately incomplete.  */
 struct pending_option;
 struct op;
-struct strbuf;
-struct _cpp_file;
+struct _cpp_strbuf;
 
 typedef bool (*convert_f) (iconv_t, const unsigned char *, size_t,
-                          struct strbuf *);
+                          struct _cpp_strbuf *);
 struct cset_converter
 {
   convert_f func;
@@ -102,7 +100,7 @@ struct cpp_macro
   } exp;
 
   /* Definition line number.  */
-  unsigned int line;
+  fileline line;
 
   /* Number of tokens in expansion, or bytes for traditional macros.  */
   unsigned int count;
@@ -309,11 +307,6 @@ struct cpp_buffer
      include files has been calculated and stored in "dir" below.  */
   unsigned char search_cached;
 
-  /* At EOF, a buffer is automatically popped.  If RETURN_AT_EOF is
-     true, a CPP_EOF token is then returned.  Otherwise, the next
-     token from the enclosing buffer is returned.  */
-  bool return_at_eof;
-
   /* 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_dir dir;
@@ -339,10 +332,10 @@ struct cpp_reader
   /* Source line tracking.  */
   struct line_maps line_maps;
   const struct line_map *map;
-  unsigned int line;
+  fileline line;
 
   /* The line of the '#' of the current directive.  */
-  unsigned int directive_line;
+  fileline directive_line;
 
   /* Memory buffers.  */
   _cpp_buff *a_buff;           /* Aligned permanent storage.  */
@@ -361,11 +354,13 @@ struct cpp_reader
   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;
+  /* Chain of all hashed _cpp_file instances.  */
+  struct _cpp_file *all_files;
+
+  struct _cpp_file *main_file;
 
   /* File and directory hash table.  */
-  htab_t file_hash;
+  struct htab *file_hash;
   struct file_hash_entry *file_hash_entries;
   unsigned int file_hash_entries_allocated, file_hash_entries_used;
 
@@ -373,8 +368,9 @@ struct cpp_reader
      directory.  */
   bool quote_ignores_source_dir;
 
-  /* Non-zero if any file has contained #pragma once.  */
-  bool saw_pragma_once;
+  /* Nonzero if any file has contained #pragma once or #import has
+     been used.  */
+  bool seen_once_only;
 
   /* Multiple include optimization.  */
   const cpp_hashnode *mi_cmacro;
@@ -452,7 +448,7 @@ struct cpp_reader
     uchar *base;
     uchar *limit;
     uchar *cur;
-    unsigned int first_line;
+    fileline first_line;
   } out;
 
   /* Used to save the original line number during traditional
@@ -498,7 +494,7 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
 #define CPP_WTRADITIONAL(PF) CPP_OPTION (PF, warn_traditional)
 
 /* In cpperror.c  */
-extern int _cpp_begin_message (cpp_reader *, int, unsigned int, unsigned int);
+extern int _cpp_begin_message (cpp_reader *, int, fileline, unsigned int);
 
 /* In cppmacro.c */
 extern void _cpp_free_definition (cpp_hashnode *);
@@ -516,9 +512,13 @@ 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);
+typedef struct _cpp_file _cpp_file;
+extern _cpp_file *_cpp_find_file (cpp_reader *, const char *fname,
+                                 cpp_dir *start_dir, bool fake);
+extern bool _cpp_find_failed (_cpp_file *);
+extern void _cpp_mark_file_once_only (cpp_reader *, struct _cpp_file *);
 extern void _cpp_fake_include (cpp_reader *, const char *);
-extern bool _cpp_stack_file (cpp_reader *, const char *);
+extern bool _cpp_stack_file (cpp_reader *, _cpp_file*, bool);
 extern bool _cpp_stack_include (cpp_reader *, const char *, int,
                                enum include_type);
 extern int _cpp_compare_file_date (cpp_reader *, const char *, int);