r195323 - Add new attribute 'objc_suppress_protocol' to suppress protocol conformance for a class.

Ted Kremenek kremenek at apple.com
Thu Nov 21 08:00:50 PST 2013


Thanks for the feedback!

On Nov 21, 2013, at 5:27 AM, Aaron Ballman <aaron at aaronballman.com> wrote:

> These checks can be simplified once you remove the ,1 from Attr.td --
> the common attribute checker will already bail out if there are no
> args passed, so you can simply do:

I thought so.  Thanks for clarifying.

> 
> if (!Attr.isArgIdent(0)) {
>  S.Diag(Attr.getLoc(), diag::err_attribute_argument_type) << Attr.getName()
>    << AANT_ArgumentIdentifier;
>  return;
> }
> IdentifierInfo *Parm = Attr.getArgAsIdent(0)->Ident;
> 
> You should also add a test case for the number and type of args passed in.

We are deliberately not checking for the type of the arguments.  The protocol does not need to exist in the translation unit for this attribute to be applied.

> 
> As for the err_objc_attr_not_id logic, you should actually be checking
> that instead of assuming any identifier counts, and this logic should
> have a test case.

I agree.  Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131121/0a9c9cb0/attachment.html>


More information about the cfe-commits mailing list