[cfe-commits] r148085 - in /cfe/trunk: include/clang/Sema/TypoCorrection.h lib/Sema/SemaDeclObjC.cpp lib/Sema/SemaExprObjC.cpp

Kaelyn Uhrain rikka at google.com
Fri Jan 13 10:06:19 PST 2012


On Thu, Jan 12, 2012 at 5:47 PM, Chandler Carruth <chandlerc at google.com>wrote:

> On Thu, Jan 12, 2012 at 5:32 PM, Kaelyn Uhrain <rikka at google.com> wrote:
>
>> Author: rikka
>> Date: Thu Jan 12 19:32:50 2012
>> New Revision: 148085
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=148085&view=rev
>> Log:
>> Fix up the calls to CorrectTypo in Sema*ObjC.cpp to use callback
>> objects, and add a basic CorrectionCandidateCallback template class
>> to simplify the fixups.
>>
>
> I'm a bit to sad about the lack of tests. I don't know ObjC very well
> either, but I think we should look at the objc typo correction tests and at
> least try to build some...
>

The tests that would show a difference are specific enough that I doubt I
could cobble them together from other objc typo correction tests--I don't
have the slightest clue about the objc-specific syntax and am fuzzy enough
about the terminology such as interface versus property to have no idea how
to assemble false positives for CorrectTypo to return that the code which
called CorrectTypo would then reject.


> One minor comment on the patch:
>
> Modified: cfe/trunk/include/clang/Sema/TypoCorrection.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/TypoCorrection.h?rev=148085&r1=148084&r2=148085&view=diff
>>
>> ==============================================================================
>> --- cfe/trunk/include/clang/Sema/TypoCorrection.h (original)
>> +++ cfe/trunk/include/clang/Sema/TypoCorrection.h Thu Jan 12 19:32:50 2012
>> @@ -110,6 +110,12 @@
>>         CorrectionDecls.front() == 0;
>>   }
>>
>> +  // Check if this TypoCorrection is the given keyword.
>> +  template<std::size_t StrLen>
>> +  bool isKeyword(const char (&Str)[StrLen]) const {
>>
>
> Please just accept a StringRef here.
>

I don't think that would work since the parameters are duplicated from
IdentifierInfo::isStr--and unless I'm totally misinterpreting the
parameters, I'm pretty certain that isStr only accepts a fixed-size
character array whose length is known at compile-time.

- Kaelyn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120113/089421a5/attachment.html>


More information about the cfe-commits mailing list