OSDN Git Service

* config/h8300/h8300.md (*movsf_h8300h): Change to
[pf3gnuchains/gcc-fork.git] / gcc / cpplib.h
index b63f363..b104295 100644 (file)
@@ -174,7 +174,7 @@ struct cpp_string
    occupy 16 bytes on 32-bit hosts and 24 bytes on 64-bit hosts.  */
 struct cpp_token
 {
-  unsigned int line;           /* Logical line of first char of token.  */
+  fileline line;               /* Logical line of first char of token.  */
   unsigned short col;          /* Column of first char of token.  */
   ENUM_BITFIELD(cpp_ttype) type : CHAR_BIT;  /* token type */
   unsigned char flags;         /* flags - see above */
@@ -382,7 +382,13 @@ struct cpp_callbacks
 {
   /* Called when a new line of preprocessed output is started.  */
   void (*line_change) (cpp_reader *, const cpp_token *, int);
+
+  /* Called when switching to/from a new file.
+     The line_map is for the new file.  It is NULL if there is no new file.
+     (In C this happens when done with <built-in>+<command line> and also
+     when done with a main file.)  This can be used for resource cleanup.  */
   void (*file_change) (cpp_reader *, const struct line_map *);
+
   void (*dir_change) (cpp_reader *, const char *);
   void (*include) (cpp_reader *, unsigned int, const unsigned char *,
                   const char *, int);
@@ -526,12 +532,14 @@ extern const struct line_maps *cpp_get_line_maps (cpp_reader *);
 extern cpp_callbacks *cpp_get_callbacks (cpp_reader *);
 extern void cpp_set_callbacks (cpp_reader *, cpp_callbacks *);
 
-/* This function reads the file, but does not start preprocessing.  It
-   returns the name of the original file; this is the same as the
-   input file, except for preprocessed input.  This will generate at
-   least one file change callback, and possibly a line change callback
-   too.  If there was an error opening the file, it returns NULL.  */
-extern const char *cpp_read_main_file (cpp_reader *, const char *);
+/* This function finds the main file, but does not start reading it.
+   Returns true iff the file was found.  */
+extern bool cpp_find_main_file (cpp_reader *, const char *);
+
+/* This function reads the file, but does not start preprocessing.
+   This will generate at least one file change callback, and possibly
+   a line change callback.  */
+extern void cpp_push_main_file (cpp_reader *);
 
 /* Set up built-ins like __FILE__.  */
 extern void cpp_init_builtins (cpp_reader *, int);
@@ -590,7 +598,7 @@ extern void cpp_unassert (cpp_reader *, const char *);
 extern void cpp_undef_all (cpp_reader *);
 
 extern cpp_buffer *cpp_push_buffer (cpp_reader *, const unsigned char *,
-                                   size_t, int, int);
+                                   size_t, int);
 extern int cpp_defined (cpp_reader *, const unsigned char *, int);
 
 /* A preprocessing number.  Code assumes that any unused high bits of
@@ -647,21 +655,21 @@ cpp_num cpp_num_sign_extend (cpp_num, size_t);
    with a line number of zero.  */
 
 /* Warning, an error with -Werror.  */
-#define DL_WARNING             0x00
-/* Same as DL_WARNING, except it is not suppressed in system headers.  */
-#define DL_WARNING_SYSHDR      0x01
+#define CPP_DL_WARNING         0x00
+/* Same as CPP_DL_WARNING, except it is not suppressed in system headers.  */
+#define CPP_DL_WARNING_SYSHDR  0x01
 /* Warning, an error with -pedantic-errors or -Werror.  */
-#define DL_PEDWARN             0x02
+#define CPP_DL_PEDWARN         0x02
 /* An error.  */
-#define DL_ERROR               0x03
+#define CPP_DL_ERROR           0x03
 /* An internal consistency check failed.  Prints "internal error: ",
-   otherwise the same as DL_ERROR.  */
-#define DL_ICE                 0x04
+   otherwise the same as CPP_DL_ERROR.  */
+#define CPP_DL_ICE             0x04
 /* Extracts a diagnostic level from an int.  */
-#define DL_EXTRACT(l)          (l & 0xf)
+#define CPP_DL_EXTRACT(l)      (l & 0xf)
 /* Nonzero if a diagnostic level is one of the warnings.  */
-#define DL_WARNING_P(l)                (DL_EXTRACT (l) >= DL_WARNING \
-                                && DL_EXTRACT (l) <= DL_PEDWARN)
+#define CPP_DL_WARNING_P(l)    (CPP_DL_EXTRACT (l) >= CPP_DL_WARNING \
+                                && CPP_DL_EXTRACT (l) <= CPP_DL_PEDWARN)
 
 /* N.B. The error-message-printer prototypes have not been nicely
    formatted because exgettext needs to see 'msgid' on the same line
@@ -680,8 +688,8 @@ extern void cpp_errno (cpp_reader *, int, const char *msgid);
 /* Same as cpp_error, except additionally specifies a position as a
    (translation unit) physical line and physical column.  If the line is
    zero, then no location is printed.  */
-extern void cpp_error_with_line (cpp_reader *, int, unsigned, unsigned, const char *msgid, ...)
-  ATTRIBUTE_PRINTF_5;
+extern void cpp_error_with_line (cpp_reader *, int, fileline, unsigned,
+                                const char *msgid, ...) ATTRIBUTE_PRINTF_5;
 
 /* In cpplex.c */
 extern int cpp_ideq (const cpp_token *, const char *);