diagnostics: support compact printing of secondary locations
commita8a31e3d77f1ae787a3801c4ee4cc4ab9a031e06
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jul 2017 13:43:31 +0000 (11 13:43 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 11 Jul 2017 13:43:31 +0000 (11 13:43 +0000)
treeacbc15e7a9bfdeafeb290b090773e2ae649fdc6f
parentd4bcda1c22c9199f908c0bdda7e579e57883243e
diagnostics: support compact printing of secondary locations

gcc/ChangeLog:
* diagnostic-show-locus.c: Include "gcc-rich-location.h".
(layout::m_primary_loc): New field.
(layout::layout): Initialize new field.  Move location filtering
logic from here to...
(layout::maybe_add_location_range): ...this new method.  Add
support for filtering to just the lines already specified by other
locations.
(layout::will_show_line_p): New method.
(selftest::test_add_location_if_nearby): New test function.
(selftest::diagnostic_show_locus_c_tests): Call it.
* gcc-rich-location.h (gcc_rich_location::add_location_if_nearby):
New method.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@250133 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/diagnostic-show-locus.c
gcc/gcc-rich-location.h