[cfe-commits] PATCH: Better handle overloaded functions in typo correction

Kaelyn Uhrain rikka at google.com
Mon Jul 18 13:46:21 PDT 2011


I've addresses your comments and updated the patch. Thanks for reviewing it,
Chandler! :)

I've also attached the updated patch that e.g. doesn't dynamically allocate
the CorrectionDeclSet and doesn't maintain a separate flag for whether the
correction is a keyword. I've also changed the KeywordDecl to be ~0x3
instead of -1 to avoid issues with data structures (such as UnresolvedSet
that the first version of the patch used) assuming pointers are 64-bit
aligned and manipulating the low 3 bits internally.

Cheers,
Kaelyn

On Fri, Jul 15, 2011 at 6:34 PM, Chandler Carruth <chandlerc at google.com>wrote:

> FYI, comments on the codereview page. =] Thanks!
>
> On Fri, Jul 15, 2011 at 5:06 PM, Kaelyn Uhrain <rikka at google.com> wrote:
>
>> This patch improves how typo correction deals with overloaded functions,
>> e.g. Sema::CorrectTypo now returns a set of Decls in the TypoCorrection if
>> the lookup of a correction has a result kind of
>> LookupResult::FoundOverloaded, and Sema::DiagnoseEmptyLookup has been
>> modified to try to choose the best Decl from the set. With these changes,
>> TypoCorrection is one step closer to never returning a non-keyword
>> correction with a NULL Decl. I also ran memcheck using
>> test/FixIt/typo-crash.cpp as a quick sanity check that I didn't accidentally
>> introduce any memory leaks with the changes to the TypoCorrection class
>> (though I think dynamically allocating the UnresolvedSet may be a bit of
>> overkill and generally unnecessary--thoughts?).
>>
>> The changes can also be reviewed at:
>> http://codereview.appspot.com/4747047
>>
>> Cheers,
>> Kaelyn
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110718/06fd1aac/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typo-correction-overload.diff
Type: text/x-diff
Size: 11242 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20110718/06fd1aac/attachment.diff>


More information about the cfe-commits mailing list