summaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-30 23:09:06 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-30 23:09:06 +0000
commitc907c5b1c101b68b89d1530b7ae8b47dff169617 (patch)
treeaaf251a28f0a2167060005edc8eb763baadddd63 /gcc/diagnostic.c
parenta55dc2cd86f718c1ad76ce7d418c9a8a44b2440b (diff)
downloadgcc-c907c5b1c101b68b89d1530b7ae8b47dff169617.tar.gz
gcc:
* pretty-print.h (PP_NL_ARGMAX): New. (text_info): Add locus. (struct chunk_info): New. (output_buffer): Add formatted_obstack, chunk_obstack, and cur_chunk_array. Change obstack to a pointer. (pp_wrapping_mode_t, pp_wrapping_mode, pp_set_verbatim_wrapping): New. (struct pretty_print_info): Replace ideal_maximum_length and prefixing_rule with wrapping. (pp_line_cutoff, pp_prefixing_rule): Update to match. Update prototypes and wrapper macros throughout. * pretty-print.c (pp_formatted_text_data, pp_append_r) (pp_base_clear_output_area, pp_construct, pp_base_formatted_text) (pp_base_last_position_in_text, pp_base_newline, pp_base_character): Update for changes to pp structure. (pp_base_prepare_to_format, pp_base_format_text): Delete. (pp_base_format, pp_base_output_formatted_text): New functions. (pp_base_format_verbatim): Use pp_set_verbatim_wrapping. (pp_verbatim): Clear text.locus. (pp_printf): Likewise. Use pp_format and pp_output_formatted_text. * c-objc-common.c (c_tree_printer): Update function signature. * diagnostic.c (diagnostic_initialize): Update for changes to pp structure. (diagnostic_report_diagnostic): Call pp_format and then pp_output_formatted_text. (verbatim): Clear text.locus. * diagnostic.h (diagnostic_prefixing_rule, diagnostic_line_cutoff): Update for changes to pp structure. * c-lang.c: No need to include c-pretty-print.h. * Makefile.in: Remove bogus line containing only a tab. (c-lang.o): Update dependencies. * toplev.c (announce_function): Don't use verbatim. (default_tree_printer): Update signature. * objc/objc-lang.c: No need to include c-pretty-print.h. * objc/Make-lang.in: Update dependencies. gcc/cp: * cp-lang.c: No need to include cxx-pretty-print.h. * error.c (cp_printer): Update signature. No need to process flags. (print_instantiation_partial_context): Output last newline with pp_base_newline. * Make-lang.in: Update dependencies. gcc/objcp: * objcp-lang.c: No need to include cxx-pretty-print.h. * Make-lang.in: Update dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101481 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c7217b27471..ef4b07f4226 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -97,7 +97,7 @@ diagnostic_initialize (diagnostic_context *context)
/* By default, diagnostics are sent to stderr. */
context->printer->buffer->stream = stderr;
/* By default, we emit prefixes once per message. */
- context->printer->prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_ONCE;
+ context->printer->wrapping.rule = DIAGNOSTICS_SHOW_PREFIX_ONCE;
memset (context->diagnostic_count, 0, sizeof context->diagnostic_count);
context->issue_warnings_are_errors_message = true;
@@ -347,10 +347,10 @@ diagnostic_report_diagnostic (diagnostic_context *context,
= ACONCAT ((diagnostic->message.format_spec,
" [", cl_options[diagnostic->option_index].opt_text, "]", NULL));
- pp_prepare_to_format (context->printer, &diagnostic->message,
- &diagnostic->location);
+ diagnostic->message.locus = &diagnostic->location;
+ pp_format (context->printer, &diagnostic->message);
(*diagnostic_starter (context)) (context, diagnostic);
- pp_format_text (context->printer, &diagnostic->message);
+ pp_output_formatted_text (context->printer);
(*diagnostic_finalizer (context)) (context, diagnostic);
pp_flush (context->printer);
diagnostic_action_after_output (context, diagnostic);
@@ -405,6 +405,7 @@ verbatim (const char *gmsgid, ...)
text.err_no = errno;
text.args_ptr = &ap;
text.format_spec = _(gmsgid);
+ text.locus = NULL;
pp_format_verbatim (global_dc->printer, &text);
pp_flush (global_dc->printer);
va_end (ap);