Previously, diagnostic_show_locus saved and restored the pretty_printer's prefix, clearing it for the duration of the call. I have a patch kit in development that can benefit from applying a prefix to the output of d_s_l, so this patch adds support to d_s_l for printing such prefixes. It moves the save and restore of the pp's prefix from d_s_l to all of its callers, and updates diagnostic-show-locus.c to properly handle prefixes. gcc/c-family/ChangeLog: * c-opts.c (c_diagnostic_finalizer): Temporarily clear prefix when calling diagnostic_show_locus, rather than destroying it afterwards. gcc/ChangeLog: * diagnostic-show-locus.c (layout::print_gap_in_line_numbering): Call pp_emit_prefix. (layout::print_source_line): Likewise. (layout::start_annotation_line): Likewise. (diagnostic_show_locus): Remove call to temporarily clear the prefix. (selftest::test_one_liner_fixit_remove): Add test coverage for the interaction of pp_set_prefix with rulers and fix-it hints. * diagnostic.c (default_diagnostic_finalizer): Temporarily clear prefix when calling diagnostic_show_locus, rather than destroying it afterwards. (print_parseable_fixits): Temporarily clear prefix. * pretty-print.c (pp_format): Save and restore line_length, rather than assuming it is zero. (pp_output_formatted_text): Remove assertion that line_length is zero. gcc/fortran/ChangeLog: * error.c (gfc_diagnostic_starter): Clear the prefix before calling diagnostic_show_locus. gcc/testsuite/ChangeLog: * gcc.dg/plugin/diagnostic_group_plugin.c (test_begin_group_cb): Clear the prefix before emitting the "END GROUP" line. * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c (custom_diagnostic_finalizer): Temporarily clear prefix when calling diagnostic_show_locus, rather than destroying it afterwards. From-SVN: r276433
Name |
Last commit
|
Last update |
---|---|---|
.. | ||
ChangeLog | Loading commit data... | |
ChangeLog.gimple-classes | Loading commit data... | |
c-ada-spec.c | Loading commit data... | |
c-ada-spec.h | Loading commit data... | |
c-attribs.c | Loading commit data... | |
c-common.c | Loading commit data... | |
c-common.def | Loading commit data... | |
c-common.h | Loading commit data... | |
c-cppbuiltin.c | Loading commit data... | |
c-dump.c | Loading commit data... | |
c-format.c | Loading commit data... | |
c-format.h | Loading commit data... | |
c-gimplify.c | Loading commit data... | |
c-indentation.c | Loading commit data... | |
c-indentation.h | Loading commit data... | |
c-lex.c | Loading commit data... | |
c-objc.h | Loading commit data... | |
c-omp.c | Loading commit data... | |
c-opts.c | Loading commit data... | |
c-pch.c | Loading commit data... | |
c-ppoutput.c | Loading commit data... | |
c-pragma.c | Loading commit data... | |
c-pragma.h | Loading commit data... | |
c-pretty-print.c | Loading commit data... | |
c-pretty-print.h | Loading commit data... | |
c-semantics.c | Loading commit data... | |
c-spellcheck.cc | Loading commit data... | |
c-spellcheck.h | Loading commit data... | |
c-target-def.h | Loading commit data... | |
c-target.def | Loading commit data... | |
c-target.h | Loading commit data... | |
c-ubsan.c | Loading commit data... | |
c-ubsan.h | Loading commit data... | |
c-warn.c | Loading commit data... | |
c.opt | Loading commit data... | |
cppspec.c | Loading commit data... | |
known-headers.cc | Loading commit data... | |
known-headers.h | Loading commit data... | |
name-hint.h | Loading commit data... | |
stub-objc.c | Loading commit data... |