substring-locations: add class format_string_diagnostic_t
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 17 Sep 2018 20:31:01 +0000 (20:31 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 17 Sep 2018 20:31:01 +0000 (20:31 +0000)
commitc896ecfeab0658dc61ed0a9ad4b649c69d1d8679
treec755d1e0d94404c15b74070d31c234e3d0d6d0e6
parent69d7aabfd8fec442047cefb136b1fd2680310fa9
substring-locations: add class format_string_diagnostic_t

With the addition of ranges in r263564, format_warning_at_substring_n
has 10 arguments.

Reduce the number of args by bundling the shared ones into a
class format_string_diagnostic_t.

gcc/c-family/ChangeLog:
* c-format.c (format_warning_at_char): Update for introduction of
format_string_diagnostic_t.
(format_type_warning): Likewise.

gcc/ChangeLog:
* gimple-ssa-sprintf.c (fmtwarn): Update for introduction of
format_string_diagnostic_t.
(fmtwarn_n): Likewise.
* substring-locations.c
(format_string_diagnostic_t::format_string_diagnostic_t) New ctor.
(format_warning_n_va): Convert to...
(format_string_diagnostic_t::emit_warning_n_va): ...this.
(format_warning_va): Convert to...
(format_string_diagnostic_t::emit_warning_va): ...this.
(format_warning_at_substring): Convert to...
(format_string_diagnostic_t::emit_warning): ...this.
(format_warning_at_substring_n): Convert to...
(format_string_diagnostic_t::emit_warning_n): ...this.
* substring-locations.h (class format_string_diagnostic_t): New
class.
(format_warning_va): Convert to
format_string_diagnostic_t::emit_warning_va.
(format_warning_n_va): Convert to
format_string_diagnostic_t::emit_warning_n_va.
(format_warning_at_substring): Convert to
format_string_diagnostic_t::emit_warning.
(format_warning_at_substring_n): Convert to
format_string_diagnostic_t::emit_warning_n.

From-SVN: r264372
gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c-format.c
gcc/gimple-ssa-sprintf.c
gcc/substring-locations.c
gcc/substring-locations.h