]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add range_idx param to range_label::get_text
authordmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Sep 2018 23:32:12 +0000 (23:32 +0000)
committerdmalcolm <dmalcolm@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 17 Sep 2018 23:32:12 +0000 (23:32 +0000)
commita2507e3dbf1a25ba23eb69771d70669de1bdba05
treec99eac9e12ee799efbd01d27abbba880659e4241
parent874684e59176db22760c80d4747fb33ea5361cc8
Add range_idx param to range_label::get_text

This patch updates the pure virtual function range_label::get_text
(and its implementations) so that the index of the range is passed
in, allowing for one label instance to be shared by multiple ranges.

gcc/c-family/ChangeLog:
* c-format.c (range_label_for_format_type_mismatch::get_text):
Update for new param.

gcc/c/ChangeLog:
* c-objc-common.c (range_label_for_type_mismatch::get_text):
Update for new param.
* c-typeck.c (maybe_range_label_for_tree_type_mismatch::get_text):
Likewise.

gcc/cp/ChangeLog:
* error.c (range_label_for_type_mismatch::get_text): Update for
new param.

gcc/ChangeLog:
* diagnostic-show-locus.c (class layout_range): Add field
"m_original_idx".
(layout_range::layout_range): Add "original_idx" param and use it
to initialize new field.
(make_range): Use 0 for original_idx.
(layout::layout): Pass in index to calls to
maybe_add_location_range.
(layout::maybe_add_location_range): Add param "original_idx" and
pass it on to layout_range.
(layout::print_any_labels): Pass on range->m_original_idx to
get_text call.
(gcc_rich_location::add_location_if_nearby): Use 0 for
original_idx.
* gcc-rich-location.h (text_range_label::get_text): Update for new
param.
(range_label_for_type_mismatch::get_text): Likewise.

libcpp/ChangeLog:
* include/line-map.h (range_label::get_text): Add param
"range_idx".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264376 138bc75d-0d04-0410-961f-82ee72b054a4
12 files changed:
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-format.c
gcc/c/ChangeLog
gcc/c/c-objc-common.c
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/error.c
gcc/diagnostic-show-locus.c
gcc/gcc-rich-location.h
libcpp/ChangeLog
libcpp/include/line-map.h