Offer suggestions for misspelled --param names.
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 30 Jun 2016 00:05:39 +0000 (00:05 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Thu, 30 Jun 2016 00:05:39 +0000 (00:05 +0000)
commitf4452176d8b7d718f50616c6908da8b8a9811bdf
treef0226fa372c19600fd529ccba821f68b9b1613ba
parentc5e74d9d4ebeb29fab731464c206296ec651e9a6
Offer suggestions for misspelled --param names.

gcc/ChangeLog:
* opts.c (handle_param): Use find_param_fuzzy to offer suggestions
for misspelled param names.
* params.c: Include spellcheck.h.
(find_param_fuzzy): New function.
* params.h (find_param_fuzzy): New prototype.
* spellcheck.c (struct edit_distance_traits<const char *>): Move
to...
* spellcheck.h (struct edit_distance_traits<const char *>):
...here.

gcc/testsuite/ChangeLog:
* gcc.dg/spellcheck-params.c: New testcase.
* gcc.dg/spellcheck-params-2.c: New testcase.

From-SVN: r237865
gcc/ChangeLog
gcc/opts.c
gcc/params.c
gcc/params.h
gcc/spellcheck.c
gcc/spellcheck.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/spellcheck-params-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/spellcheck-params.c [new file with mode: 0644]