On 07/24/2017 02:04 PM, David Malcolm wrote: > This patch reworks diagnostic_show_locus so that it respects > the prefix of the pretty_printer. > > This is used later in the patch kit for embedding source dumps > within a hierarchical tree-like dump, by using the ASCII art for the > tree as the prefix. > > gcc/c-family/ChangeLog: > * c-opts.c (c_diagnostic_finalizer): Move call to > pp_destroy_prefix to before call to diagnostic_show_locus. > > gcc/ChangeLog: > * diagnostic-show-locus.c (layout::print_source_line): > Call pp_emit_prefix. > (layout::should_print_annotation_line_p): Likewise. > (layout::print_leading_fixits): Likewise. > (layout::print_trailing_fixits): Likewise, for first correction. > (layout::print_trailing_fixits): Replace call to move_to_column > with a call to print_newline, to avoid emitting a prefix after > last line. > (layout::move_to_column): Call pp_emit_prefix. > (layout::show_ruler): Likewise. > (diagnostic_show_locus): Remove save/restore of prefix. > (selftest::test_diagnostic_context::test_diagnostic_context): Set > prefixing rule to DIAGNOSTICS_SHOW_PREFIX_NEVER. > (selftest::test_one_liner_fixit_remove): Verify the interaction of > pp_set_prefix with rulers and fix-it hints. > * diagnostic.c (default_diagnostic_start_span_fn): Don't modify > the prefix. > > gcc/testsuite/ChangeLog: > * gcc.dg/plugin/diagnostic_plugin_test_show_locus.c > (custom_diagnostic_finalizer): Reset pp_indentation of printer. I don't see anything here concerning. I think it's mostly a matter running with this when you need it.
jeff