Commit Graph

6 Commits

Author SHA1 Message Date
Kaelyn Uhrain b02c5e9356 Convert SemaInit.cpp to pass a callback object to CorrectTypo.
And once again improve the typo correction results in certain
situations just by moving the existing checks on the correction.

llvm-svn: 148037
2012-01-12 19:27:05 +00:00
Kaelyn Uhrain 8811b3904c Fix the caching in CorrectTypo so that other non-keyword identifiers
are still added if the cached correction fails validation.

Also fix a copy-and-paste error in a comment from my previous commit.
Finally, add an example of the benefit the typo correction callback adds
to TryNamespaceTypoCorrection--which happens to also tickle the above
caching problem, as the only way a non-namespace Decl would be added to
the possible corrections is if it was cached as the correction for a
previous instance of the same typo where the typo was corrected to a
non-namespace via a different code path.

llvm-svn: 147968
2012-01-11 21:17:51 +00:00
Kaelyn Uhrain 2d317edcfd Add initial callback object support to Sema::CorrectTypo.
Also includes two examples of the callback: a wrapper/replacement for
the CorrectTypoContext enum, and a conversion of the two calls to
CorrectTypo in SemaDeclCXX.cpp (one of which provides verifiable
improvement to the typo correction, as demonstrated in the added test).

llvm-svn: 147962
2012-01-11 19:37:46 +00:00
David Blaikie cc5f8f0d9e Switch to the C++11 warning flags in tests.
Patch by Ahmed Charles!

llvm-svn: 142340
2011-10-18 05:54:07 +00:00
Kaelyn Uhrain ad018f10bc Add an explanatory comment to test/SemaCXX/typo-correction.cpp
llvm-svn: 141680
2011-10-11 17:17:40 +00:00
Kaelyn Uhrain 85308c6ecd Add typo correction for type names.
The main motivation was to do typo correction in C++ "new" statements,
though picking it up in other places where type names are expected was
pretty much a freebie.

llvm-svn: 141621
2011-10-11 01:02:41 +00:00