On Thu, Jan 12, 2012 at 5:47 PM, Chandler Carruth <[email protected]>wrote:

> On Thu, Jan 12, 2012 at 5:32 PM, Kaelyn Uhrain <[email protected]> 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
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to