if (!m_max_errors)
return;
- int count = (diagnostic_kind_count (this, DK_ERROR)
- + diagnostic_kind_count (this, DK_SORRY)
- + diagnostic_kind_count (this, DK_WERROR));
+ int count = (m_diagnostic_count[DK_ERROR]
+ + m_diagnostic_count[DK_SORRY]
+ + m_diagnostic_count[DK_WERROR]);
if (count >= m_max_errors)
{
error has already occurred. This is counteracted by
abort_on_error. */
if (!CHECKING_P
- && (diagnostic_kind_count (this, DK_ERROR) > 0
- || diagnostic_kind_count (this, DK_SORRY) > 0)
+ && (m_diagnostic_count[DK_ERROR] > 0
+ || m_diagnostic_count[DK_SORRY] > 0)
&& !m_abort_on_error)
{
expanded_location s
diagnostic->message.m_args_ptr);
}
if (diagnostic->kind == DK_ERROR && orig_diag_kind == DK_WARNING)
- ++diagnostic_kind_count (this, DK_WERROR);
+ ++m_diagnostic_count[DK_WERROR];
else
- ++diagnostic_kind_count (this, diagnostic->kind);
+ ++m_diagnostic_count[diagnostic->kind];
/* Is this the initial diagnostic within the stack of groups? */
if (m_diagnostic_groups.m_emission_count == 0)
diagnostic_text_output_format::~diagnostic_text_output_format ()
{
/* Some of the errors may actually have been warnings. */
- if (diagnostic_kind_count (&m_context, DK_WERROR))
+ if (m_context.diagnostic_count (DK_WERROR))
{
/* -Werror was given. */
if (m_context.warning_as_error_requested_p ())
ready for use. */
#define diagnostic_ready_p() (global_dc->printer != NULL)
-/* The total count of a KIND of diagnostics emitted so far. */
-
-inline int &
-diagnostic_kind_count (diagnostic_context *context,
- diagnostic_t kind)
-{
- return context->diagnostic_count (kind);
-}
-
/* 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)
+#define errorcount global_dc->diagnostic_count (DK_ERROR)
/* Similarly, but for warnings. */
-#define warningcount diagnostic_kind_count (global_dc, DK_WARNING)
+#define warningcount global_dc->diagnostic_count (DK_WARNING)
/* Similarly, but for warnings promoted to errors. */
-#define werrorcount diagnostic_kind_count (global_dc, DK_WERROR)
+#define werrorcount global_dc->diagnostic_count (DK_WERROR)
/* Similarly, but for sorrys. */
-#define sorrycount diagnostic_kind_count (global_dc, DK_SORRY)
+#define sorrycount global_dc->diagnostic_count (DK_SORRY)
/* Returns nonzero if warnings should be emitted. */
#define diagnostic_report_warnings_p(DC, LOC) \