diagnostic paths: loosen coupling between path-printing and path_summary
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 5 Nov 2020 15:00:17 +0000 (10:00 -0500)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 5 Nov 2020 15:00:17 +0000 (10:00 -0500)
commitf8cc59ef4941c19d068b9dfe4e13753c9fd402c6
tree457d89db427b03c5bf6ba4b2677c0b38101cc451
parentcc32e81cdbb7696cd571bdb5ffe52f228f125df5
diagnostic paths: loosen coupling between path-printing and path_summary

Doing this makes followup work to add HTML path-printing cleaner.

gcc/ChangeLog:
* tree-diagnostic-path.cc (struct path_summary::event_range): Move
out of path_summary to...
(struct event_range): ...here.
(class path_summary): Convert to...
(struct path_summary): ...this.
(path_summary::m_ranges): Drop "private".
(path_summary::print): Convert to...
(print_path_summary_as_text): ...this, passing in the path_summary
explicitly.
(default_tree_diagnostic_path_printer): Update for above change.
(selftest::test_empty_path): Likewise.
(selftest::test_intraprocedural_path): Likewise.
(selftest::test_interprocedural_path_1): Likewise.
(selftest::test_interprocedural_path_2): Likewise.
(selftest::test_recursion): Likewise.
gcc/tree-diagnostic-path.cc