c-format.c: cleanup of check_format_info_main
authorDavid Malcolm <dmalcolm@redhat.com>
Mon, 8 Aug 2016 18:10:54 +0000 (18:10 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Mon, 8 Aug 2016 18:10:54 +0000 (18:10 +0000)
commit1c4d457e82695db889b52f62e4d45dec83e1d7f1
tree663ab8e6b537e7e88f55ea4ae185dac2a4da75c8
parent66c3dd8c1b53072d64bcbee48a4aec4d10612356
c-format.c: cleanup of check_format_info_main

gcc/c-family/ChangeLog:
* c-format.c (class flag_chars_t): New class.
(struct length_modifier): New struct.
(class argument_parser): New class.
(flag_chars_t::flag_chars_t): New ctor.
(flag_chars_t::has_char_p): New method.
(flag_chars_t::add_char): New method.
(flag_chars_t::validate): New method.
(flag_chars_t::get_alloc_flag): New method.
(flag_chars_t::assignment_suppression_p): New method.
(argument_parser::argument_parser): New ctor.
(argument_parser::read_any_dollar): New method.
(argument_parser::read_format_flags): New method.
(argument_parser::read_any_format_width): New method.
(argument_parser::read_any_format_left_precision): New method.
(argument_parser::read_any_format_precision): New method.
(argument_parser::handle_alloc_chars): New method.
(argument_parser::read_any_length_modifier): New method.
(argument_parser::read_any_other_modifier): New method.
(argument_parser::find_format_char_info): New method.
(argument_parser::validate_flag_pairs): New method.
(argument_parser::give_y2k_warnings): New method.
(argument_parser::parse_any_scan_set): New method.
(argument_parser::handle_conversions): New method.
(argument_parser::check_argument_type): New method.
(check_format_info_main): Introduce classes argument_parser
and flag_chars_t, moving the code within the loop into methods
of these classes.  Make various locals "const".

From-SVN: r239247
gcc/c-family/ChangeLog
gcc/c-family/c-format.c