[cfe-commits] r46897 - in /cfe/trunk: Driver/TextDiagnosticPrinter.cpp Driver/TextDiagnosticPrinter.h Sema/Sema.h Sema/SemaDeclObjC.cpp include/clang/Basic/DiagnosticKinds.def test/Sema/method-undef-category-warn-1.m test/Sema/method-undefined-warn-1.m test/Sema/undef-protocol-methods-1.m

Steve Naroff snaroff at apple.com
Sun Feb 10 13:47:04 PST 2008


On Feb 10, 2008, at 1:26 PM, Chris Lattner wrote:

> On Feb 8, 2008, at 2:06 PM, Steve Naroff wrote:
>> A bunch-o changes to fix <rdar://problem/5716046> incomplete  
>> implementation of ObjC class warning is incomplete
>> +void Sema::CheckProtocolMethodDefs(SourceLocation ImpLoc,
>> +                                   ObjCProtocolDecl *PDecl,
> ...
>>
>>        method->getImplementationControl() !=  
>> ObjCMethodDecl::Optional) {
>> +      if (!IncompleteImpl) {
>> +        Diag(ImpLoc, diag::warn_incomplete_impl);
>> +        IncompleteImpl = true;
>> +      }
>
> This (and other instances) could be simplified to:
> if (!IncompleteImpl)  // Emit the incomplete impl warning only once.
>  IncompleteImpl = Diag(ImpLoc, diag::warn_incomplete_impl);
>

I just added a helper for this (without seeing your email  
above...weird timing:-).

I think the helper is cleaner (since it keeps the message in one  
place...instead of 6).

I could hack the helper to do as you say, however it's less important  
(since the helper is simple).

snaroff

> -Chris




More information about the cfe-commits mailing list