Offer suggestions for unrecognized sanitizer options (PR driver/78877)
authorDavid Malcolm <dmalcolm@redhat.com>
Wed, 11 Jan 2017 17:25:40 +0000 (17:25 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Wed, 11 Jan 2017 17:25:40 +0000 (17:25 +0000)
commit19ff0049cd22794359a46c86d34fa19be655ba3d
treef7ccc235482effbed0bd9a6cbea869c2ac6b3d44
parentd29bd378ab8da3e646e3735c5ba140ec07f3c9fa
Offer suggestions for unrecognized sanitizer options (PR driver/78877)

gcc/ChangeLog:
PR driver/78877
* opts.c: Include "spellcheck.h"
(struct string_fragment): New struct.
(struct edit_distance_traits<const string_fragment &>): New
struct.
(get_closest_sanitizer_option): New function.
(parse_sanitizer_options): Offer suggestions for unrecognized arguments.

gcc/testsuite/ChangeLog:
PR driver/78877
* gcc.dg/spellcheck-options-14.c: New test case.
* gcc.dg/spellcheck-options-15.c: New test case.
* gcc.dg/spellcheck-options-16.c: New test case.
* gcc.dg/spellcheck-options-17.c: New test case.

From-SVN: r244325
gcc/ChangeLog
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/spellcheck-options-14.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/spellcheck-options-15.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/spellcheck-options-16.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/spellcheck-options-17.c [new file with mode: 0644]