diff options
author | David Malcolm <dmalcolm@redhat.com> | 2016-06-15 03:29:39 +0000 |
---|---|---|
committer | David Malcolm <dmalcolm@gcc.gnu.org> | 2016-06-15 03:29:39 +0000 |
commit | 6a3f203c3cc8e0f0757f7ed038b3cb34063936ba (patch) | |
tree | e99b8b2be80b721ed128799b811f4eccae4a9f64 /gcc/c | |
parent | 9e990b5d19d930bd1769d6db455fcbda8e7eae11 (diff) | |
download | gcc-6a3f203c3cc8e0f0757f7ed038b3cb34063936ba.zip gcc-6a3f203c3cc8e0f0757f7ed038b3cb34063936ba.tar.gz gcc-6a3f203c3cc8e0f0757f7ed038b3cb34063936ba.tar.bz2 |
spellcheck.h: add best_match template; implement early-reject
gcc/c/ChangeLog:
* c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h.
gcc/cp/ChangeLog:
* search.c: Include spellcheck-tree.h rather than spellcheck.h.
gcc/ChangeLog:
* spellcheck-tree.c: Include spellcheck-tree.h rather than
spellcheck.h.
(find_closest_identifier): Reimplement in terms of
best_match<tree,tree>.
* spellcheck-tree.h: New file.
* spellcheck.c (struct edit_distance_traits<const char *>): New
struct.
(find_closest_string): Reimplement in terms of
best_match<const char *, const char *>.
* spellcheck.h (levenshtein_distance): Move prototype of tree-based
overload to spellcheck-tree.h.
(find_closest_identifier): Likewise.
(struct edit_distance_traits<T>): New template.
(class best_match): New class.
From-SVN: r237471
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 85fe5e3..e5d84bb 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,5 +1,9 @@ 2016-06-14 David Malcolm <dmalcolm@redhat.com> + * c-typeck.c: Include spellcheck-tree.h rather than spellcheck.h. + +2016-06-14 David Malcolm <dmalcolm@redhat.com> + * c-typeck.c (build_component_ref): Simplify fixit code by using gcc_rich_location::add_fixit_misspelled_id. (set_init_label): Likewise. diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index f987508..f03c07b 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see #include "c-family/c-ubsan.h" #include "cilk.h" #include "gomp-constants.h" -#include "spellcheck.h" +#include "spellcheck-tree.h" #include "gcc-rich-location.h" /* Possible cases of implicit bad conversions. Used to select |