Lines Matching refs:context

94 diagnostic_initialize (diagnostic_context *context)
98 context->printer = XNEW (pretty_printer);
99 pp_construct (context->printer, NULL, 0);
101 context->printer->buffer->stream = stderr;
103 context->printer->wrapping.rule = DIAGNOSTICS_SHOW_PREFIX_ONCE;
105 memset (context->diagnostic_count, 0, sizeof context->diagnostic_count);
106 context->issue_warnings_are_errors_message = true;
107 context->warning_as_error_requested = false;
108 memset (context->classify_diagnostic, DK_UNSPECIFIED,
109 sizeof context->classify_diagnostic);
110 context->show_option_requested = false;
111 context->abort_on_error = false;
112 context->internal_error = NULL;
113 diagnostic_starter (context) = default_diagnostic_starter;
114 diagnostic_finalizer (context) = default_diagnostic_finalizer;
115 context->last_module = 0;
116 context->last_function = NULL;
117 context->lock = 0;
172 diagnostic_count_diagnostic (diagnostic_context *context,
186 if ((diagnostic_kind_count (context, DK_ERROR) > 0
187 || diagnostic_kind_count (context, DK_SORRY) > 0)
188 && !context->abort_on_error)
196 if (context->internal_error)
197 (*context->internal_error) (diagnostic->message.format_spec,
203 ++diagnostic_kind_count (context, kind);
213 if (!context->warning_as_error_requested
214 || (context->classify_diagnostic[diagnostic->option_index]
217 ++diagnostic_kind_count (context, DK_WARNING);
220 else if (context->issue_warnings_are_errors_message)
222 pp_verbatim (context->printer,
224 context->issue_warnings_are_errors_message = false;
229 ++diagnostic_kind_count (context, DK_ERROR);
239 diagnostic_action_after_output (diagnostic_context *context,
252 if (context->abort_on_error)
262 if (context->abort_on_error)
271 if (context->abort_on_error)
285 diagnostic_report_current_function (diagnostic_context *context)
287 diagnostic_report_current_module (context);
288 lang_hooks.print_error_function (context, input_filename);
292 diagnostic_report_current_module (diagnostic_context *context)
296 if (pp_needs_newline (context->printer))
298 pp_newline (context->printer);
299 pp_needs_newline (context->printer) = false;
303 if (p && diagnostic_last_module_changed (context))
306 pp_verbatim (context->printer,
312 pp_verbatim (context->printer,
316 pp_verbatim (context->printer, ":");
317 diagnostic_set_last_module (context);
318 pp_newline (context->printer);
323 default_diagnostic_starter (diagnostic_context *context,
326 diagnostic_report_current_function (context);
327 pp_set_prefix (context->printer, diagnostic_build_prefix (diagnostic));
331 default_diagnostic_finalizer (diagnostic_context *context,
334 pp_destroy_prefix (context->printer);
341 diagnostic_classify_diagnostic (diagnostic_context *context,
352 old_kind = context->classify_diagnostic[option_index];
353 context->classify_diagnostic[option_index] = new_kind;
364 diagnostic_report_diagnostic (diagnostic_context *context,
367 if (context->lock > 0)
372 if (diagnostic->kind == DK_ICE && context->lock == 1)
373 pp_flush (context->printer);
375 error_recursion (context);
386 if (context->classify_diagnostic[diagnostic->option_index] != DK_UNSPECIFIED)
387 diagnostic->kind = context->classify_diagnostic[diagnostic->option_index];
394 context->lock++;
396 if (diagnostic_count_diagnostic (context, diagnostic))
400 if (context->show_option_requested && diagnostic->option_index)
406 pp_format (context->printer, &diagnostic->message);
407 (*diagnostic_starter (context)) (context, diagnostic);
408 pp_output_formatted_text (context->printer);
409 (*diagnostic_finalizer (context)) (context, diagnostic);
410 pp_flush (context->printer);
411 diagnostic_action_after_output (context, diagnostic);
415 context->lock--;
619 error_recursion (diagnostic_context *context)
623 if (context->lock < 3)
624 pp_flush (context->printer);
632 diagnostic_action_after_output (context, &diagnostic);