diagnostic.h (diagnostic_count): Move from output_buffer to diagnostic_context.
authorGabriel Dos Reis <gdr@codesourcery.com>
Mon, 3 Jun 2002 19:08:59 +0000 (19:08 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Mon, 3 Jun 2002 19:08:59 +0000 (19:08 +0000)
* diagnostic.h (diagnostic_count): Move from output_buffer to
diagnostic_context.
(diagnostic_kind_count): Adjust definition.

From-SVN: r54218

gcc/ChangeLog
gcc/diagnostic.h

index 9b61fa6011ab20d17a31dcc7ab90c5e699a7a7b8..82bb095c6cfc156738d18b80af41093be7332523 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-03  Gabriel Dos Reis  <gdr@codesourcery.com>
+
+       * diagnostic.h (diagnostic_count): Move from output_buffer to 
+       diagnostic_context.
+       (diagnostic_kind_count): Adjust definition.
+
 Mon Jun  3 19:11:53 CEST 2002  Jan Hubicka  <jh@suse.cz>
 
        * except.c (except.c): Do not rebuild CFG.
index 3762136d0b62f233f9e019003a00a31dd3a38c22..aae4f56fc0bad645e4f8e25d3c29c7ae3da17325 100644 (file)
@@ -90,17 +90,12 @@ typedef struct
 
   /* A pointer to the variable argument-list for formatting.  */  
   va_list *format_args;
-
-  /* The number of times we have issued diagnostics.  */
-  int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
 } output_state;
 
-/* The output buffer datatype.  This is best seen as an abstract datatype.  */
+/* The output buffer datatype.  This is best seen as an abstract datatype
+   whose fields should not be accessed directly by clients.  */
 struct output_buffer
 {
-  /* Internal data.  These fields should not be accessed directly by
-     front-ends.  */
-
   /* The current state of the buffer.  */
   output_state state;
 
@@ -152,7 +147,7 @@ struct output_buffer
 /* The amount of whitespace to be emitted when starting a new line.  */
 #define output_indentation(BUFFER) (BUFFER)->state.indent_skip
 
-/* A pointer to the formatted diagonstic message.  */
+/* A pointer to the formatted diagnostic message.  */
 #define output_message_text(BUFFER) \
    ((const char *) obstack_base (&(BUFFER)->obstack))
 
@@ -182,7 +177,7 @@ struct diagnostic_context
      purpose of message formatting.  */
   va_list *args_ptr;
 
-  /* The name of the source file involved in the diiagnostic.  */     
+  /* The name of the source file involved in the diagnostic.  */     
   const char *file;
 
   /* The line-location in the source file.  */
@@ -191,6 +186,9 @@ struct diagnostic_context
   /* Is this message a warning?  */
   int warn;
 
+  /* The number of times we have issued diagnostics.  */
+  int diagnostic_count[DK_LAST_DIAGNOSTIC_KIND];
+
   /* This function is called before any message is printed out.  It is
      responsible for preparing message prefix and such.  For example, it
      might say:
@@ -251,17 +249,16 @@ struct diagnostic_context
 
 #define diagnostic_buffer (&global_dc->buffer)
 
-/* This diagnostic context is used by front-ends that directly output
+/* 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.  */
-#define diagnostic_kind_count(DC, DK) \
-   (DC)->buffer.state.diagnostic_count[(int) (DK)]
+#define diagnostic_kind_count(DC, DK) (DC)->diagnostic_count[(int) (DK)]
 
 /* The number of errors that have been issued so far.  Ideally, these
-   would take an output_buffer as an argument.  */
+   would take a diagnostic_context as an argument.  */
 #define errorcount diagnostic_kind_count (global_dc, DK_ERROR)
 /* Similarly, but for warnings.  */
 #define warningcount diagnostic_kind_count (global_dc, DK_WARNING)