- and simillar functions. In general, such usage should be
- avoided. This global buffer will go away, once all such usage
- has been removed. */
-extern output_buffer *diagnostic_buffer;
-
-/* Prototypes */
-void initialize_diagnostics PARAMS ((void));
-void reshape_diagnostic_buffer PARAMS ((void));
-void default_initialize_buffer PARAMS ((output_buffer *));
-void init_output_buffer PARAMS ((output_buffer *, const char *, int));
-void output_clear PARAMS ((output_buffer *));
-const char *output_get_prefix PARAMS ((const output_buffer *));
-void output_set_prefix PARAMS ((output_buffer *, const char *));
-void output_destroy_prefix PARAMS ((output_buffer *));
-void output_set_maximum_length PARAMS ((output_buffer *, int));
-void output_emit_prefix PARAMS ((output_buffer *));
-void output_add_newline PARAMS ((output_buffer *));
-void output_add_space PARAMS ((output_buffer *));
-int output_space_left PARAMS ((const output_buffer *));
-void output_append PARAMS ((output_buffer *, const char *,
- const char *));
-void output_add_character PARAMS ((output_buffer *, int));
-void output_add_integer PARAMS ((output_buffer *, HOST_WIDE_INT));
-void output_add_string PARAMS ((output_buffer *, const char *));
-const char *output_finish PARAMS ((output_buffer *));
-void output_flush_on PARAMS ((output_buffer *, FILE *));
-void output_printf PARAMS ((output_buffer *, const char *,
- ...)) ATTRIBUTE_PRINTF_2;
-void output_format PARAMS ((output_buffer *, const char *));
-int output_is_line_wrapping PARAMS ((output_buffer *));
-void set_message_prefixing_rule PARAMS ((int));
-
-#endif /* __GCC_DIAGNOSTIC_H__ */
+ and similar functions. */
+extern diagnostic_context *global_dc;
+
+/* 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
+ 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)
+/* Similarly, but for sorrys. */
+#define sorrycount diagnostic_kind_count (global_dc, DK_SORRY)
+
+/* 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)
+
+/* Diagnostic related functions. */
+extern void diagnostic_initialize (diagnostic_context *);
+extern void diagnostic_report_current_module (diagnostic_context *);
+extern void diagnostic_report_current_function (diagnostic_context *);
+extern void diagnostic_report_diagnostic (diagnostic_context *,
+ diagnostic_info *);
+extern void diagnostic_set_info (diagnostic_info *, const char *, va_list *,
+ location_t, diagnostic_t);
+extern char *diagnostic_build_prefix (diagnostic_info *);
+
+/* Pure text formatting support functions. */
+extern void verbatim (const char *, ...);
+extern char *file_name_as_prefix (const char *);
+
+/* In tree-pretty-print.c */
+extern int dump_generic_node (pretty_printer *, tree, int, int, bool);
+extern void print_generic_stmt (FILE *, tree, int);
+extern void print_generic_stmt_indented (FILE *, tree, int, int);
+extern void print_generic_expr (FILE *, tree, int);
+extern void print_generic_decl (FILE *, tree, int);
+
+extern void debug_generic_expr (tree);
+extern void debug_generic_stmt (tree);
+extern void debug_c_tree (tree);
+#endif /* ! GCC_DIAGNOSTIC_H */