PR driver/67613 - spell suggestions for misspelled command line options
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 13 Nov 2015 01:59:03 +0000 (01:59 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 13 Nov 2015 01:59:03 +0000 (01:59 +0000)
commit93ebf1fdbe35eadc5e54934061a7a4d7bcdc8262
tree03490dac15713b742586dd8e47220bc1bc5db3a3
parent277fe616911ac1ce91e9f1178d648303b4a26940
PR driver/67613 - spell suggestions for misspelled command line options

gcc/ChangeLog:
PR driver/67613
* Makefile.in (GCC_OBJS): Add spellcheck.o.
(OBJS): Add spellcheck-tree.o.
* gcc.c: Include "spellcheck.h".
(suggest_option): New function.
(driver::handle_unrecognized_options): Call suggest_option to
provide a hint about misspelled options.
* spellcheck.c: Update file comment.
(levenshtein_distance): Convert 4-param implementation from static
to extern scope.  Remove note about unit tests from leading
comment for const char * implementation.  Move tree
implementation to...
* spellcheck-tree.c: New file.
* spellcheck.h (levenshtein_distance):  Add 4-param decl.

gcc/testsuite/ChangeLog:
PR driver/67613
* gcc/testsuite/gcc.dg/spellcheck-options-1.c: New file.
* gcc/testsuite/gcc.dg/spellcheck-options-2.c: New file.

From-SVN: r230285
gcc/ChangeLog
gcc/Makefile.in
gcc/gcc.c
gcc/spellcheck-tree.c [new file with mode: 0644]
gcc/spellcheck.c
gcc/spellcheck.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/spellcheck-options-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/spellcheck-options-2.c [new file with mode: 0644]