diagnostics: support compact printing of secondary locations

Programming / Compilers / GCC - dmalcolm [138bc75d-0d04-0410-961f-82ee72b054a4] - 11 July 2017 09:43 EDT

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.

a8a31e3 diagnostics: support compact printing of secondary locations
gcc/ChangeLog | 15 +++
gcc/diagnostic-show-locus.c | 273 +++++++++++++++++++++++++++++++++-----------
gcc/gcc-rich-location.h | 21 ++++
3 files changed, 243 insertions(+), 66 deletions(-)

Upstream: gcc.gnu.org


  • Share