OSDN Git Service

Fix sh-elf linker relaxation:
[pf3gnuchains/gcc-fork.git] / gcc / diagnostic.h
index c98b8e1..2c822fc 100644 (file)
@@ -1,5 +1,5 @@
 /* Various declarations for language-independent diagnostics subroutines.
-   Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
    Contributed by Gabriel Dos Reis <gdr@codesourcery.com>
 
 This file is part of GCC.
@@ -23,6 +23,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #define GCC_DIAGNOSTIC_H
 
 #include "obstack.h"
+#include "location.h"
 
 /* The type of a text to be formatted according a format specification
    along with a list of things.  */
@@ -32,7 +33,7 @@ typedef struct
   va_list *args_ptr;
 } text_info;
 
-/* Contants used to discreminate diagnostics.  */
+/* Contants used to discriminate diagnostics.  */
 typedef enum
 {
 #define DEFINE_DIAGNOSTIC_KIND(K, M) K,  
@@ -41,16 +42,6 @@ typedef enum
   DK_LAST_DIAGNOSTIC_KIND
 } diagnostic_t;
 
-/* The data structure used to record the location of a diagnostic.  */
-typedef struct
-{
-  /* The name of the source file involved in the diagnostic.  */     
-  const char *file;
-
-  /* The line-location in the source file.  */
-  int line;
-} location_t;
-
 /* A diagnostic is described by the MESSAGE to send, the FILE and LINE of
    its context and its KIND (ice, error, warning, note, ...)  See complete
    list in diagnostic.def.  */
@@ -169,6 +160,14 @@ struct output_buffer
 /* True if BUFFER is in line-wrapping mode.  */
 #define output_is_line_wrapping(BUFFER) (output_line_cutoff (BUFFER) > 0)
 
+#define output_formatted_scalar(BUFFER, FORMAT, INTEGER)       \
+  do                                                           \
+    {                                                          \
+      sprintf ((BUFFER)->digit_buffer, FORMAT, INTEGER);       \
+      output_add_string (BUFFER, (BUFFER)->digit_buffer);      \
+    }                                                          \
+  while (0)
+
 /*  Forward declarations.  */
 typedef struct diagnostic_context diagnostic_context;
 typedef void (*diagnostic_starter_fn) PARAMS ((diagnostic_context *,
@@ -191,6 +190,9 @@ struct diagnostic_context
      message, usually displayed once per compiler run.  */
   bool warnings_are_errors_message;
 
+  /* True if we should raise a SIGABRT on errors.  */
+  bool abort_on_error;
+
   /* This function is called before any message is printed out.  It is
      responsible for preparing message prefix and such.  For example, it
      might say:
@@ -260,12 +262,16 @@ struct diagnostic_context
 #define diagnostic_set_last_module(DC) \
   (DC)->last_module = input_file_stack_tick
 
+/* Raise SIGABRT on any diagnostic of severity DK_ERROR or higher.  */
+#define diagnostic_abort_on_error(DC) \
+  (DC)->abort_on_error = true
+
 /* This diagnostic_context is used by front-ends that directly output
    diagnostic messages without going through `error', `warning',
    and similar functions.  */
 extern diagnostic_context *global_dc;
 
-/* The total count of a KIND of diagnostics meitted so far.  */
+/* The total count of a KIND of diagnostics emitted so far.  */
 #define diagnostic_kind_count(DC, DK) (DC)->diagnostic_count[(int) (DK)]
 
 /* The number of errors that have been issued so far.  Ideally, these
@@ -276,14 +282,14 @@ extern diagnostic_context *global_dc;
 /* Similarly, but for sorrys.  */
 #define sorrycount diagnostic_kind_count (global_dc, DK_SORRY)
 
-/* Returns non-zero if warnings should be emitted.  */
+/* Returns nonzero if warnings should be emitted.  */
 #define diagnostic_report_warnings_p()                 \
   (!inhibit_warnings                                   \
    && !(in_system_header && !warn_system_headers))
 
 #define report_diagnostic(D) diagnostic_report_diagnostic (global_dc, D)
 
-/* Dignostic related functions.  */
+/* Diagnostic related functions.  */
 extern void diagnostic_initialize      PARAMS ((diagnostic_context *));
 extern void diagnostic_report_current_module PARAMS ((diagnostic_context *));
 extern void diagnostic_report_current_function PARAMS ((diagnostic_context *));
@@ -317,6 +323,7 @@ extern void output_add_character    PARAMS ((output_buffer *, int));
 extern void output_decimal             PARAMS ((output_buffer *, int));
 extern void output_add_string          PARAMS ((output_buffer *,
                                                 const char *));
+extern void output_add_identifier      PARAMS ((output_buffer *, tree));
 extern const char *output_finalize_message PARAMS ((output_buffer *));
 extern void output_clear_message_text  PARAMS ((output_buffer *));
 extern void output_printf              PARAMS ((output_buffer *, const char *,
@@ -326,5 +333,6 @@ extern void output_verbatim         PARAMS ((output_buffer *, const char *,
 extern void verbatim                   PARAMS ((const char *, ...))
      ATTRIBUTE_PRINTF_1;
 extern char *file_name_as_prefix       PARAMS ((const char *));
+extern void inform                      PARAMS ((const char *, ...));
 
 #endif /* ! GCC_DIAGNOSTIC_H */