[cfe-commits] r125573 - /cfe/trunk/lib/Sema/SemaDeclObjC.cpp

jahanian fjahanian at apple.com
Tue Feb 15 16:08:17 PST 2011


On Feb 15, 2011, at 3:38 PM, Chris Lattner wrote:

> 
> On Feb 15, 2011, at 9:49 AM, Fariborz Jahanian wrote:
> 
>> Author: fjahanian
>> Date: Tue Feb 15 11:49:58 2011
>> New Revision: 125573
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=125573&view=rev
>> Log:
>> Refactoring of code to issue warning on implemented
>> deprecated class and methods in objective-c.
> 
> Nice! Some minor stuff:
> 
>> +  
>> +  unsigned DIAG = diag::warn_depercated_def;
> 
> This isn't new to this patch, but 'depercated' is misspelled.
> 
>> +  if (S.Diags.getDiagnosticLevel(DIAG, ImplLoc)== Diagnostic::Ignored)
>> +    return;
> 
> There's no need to check to see if the diagnostic is ignored here, it's more efficient to not do this in this case since the warning check is so simple.

Problem is not with issuing the warning itself (which will be ignored in default mode). Problem is
with the note (to say where it was declared as deprecated) which will not be ignored in the default case
(if I undestood you correctly).


- fariborz

> 
> -Chris
> 
>> +  if (ND && ND->getAttr<DeprecatedAttr>()) {
>> +    S.Diag(ImplLoc, DIAG) << select;
>> +    if (select == 0)
>> +      S.Diag(ND->getLocation(), diag::note_method_declared_at);
>> +    else
>> +      S.Diag(ND->getLocation(), diag::note_previous_decl) << "class";
>> +  }
>> +}
>> +





More information about the cfe-commits mailing list