r196828 - Objective-C: Improve on various diagnostics related to

Jordan Rose jordan_rose at apple.com
Tue Dec 10 09:20:44 PST 2013


Thanks, this is better. Still have some comments though.

On Dec 9, 2013, at 14:04 , Fariborz Jahanian <fjahanian at apple.com> wrote:

> + def err_objc_bridged_related_unknown_method : Error<
> + "you can't convert %0 to %1, without using an existing "
> + "%select{class|instance}2 method for this conversion">;

I still don't see what this diagnostic adds. If the framework doesn't have a method name for one of the conversion directions, that probably means there's no one good way to perform this conversion. There may be no way to perform the conversion, although it's strange that they would be marked related, then.

Also, diagnostics generally don't have "you" except in the fix-it bit ("did you mean...").

How about just "%0 cannot be directly converted to %1"?


>       Diag(Loc, diag::err_objc_bridged_related_unknown_method)
> -        << SrcType << DestType << RelatedClass->getName() << 0;
> +        << SrcType << DestType << 0;

Here and elsewhere I think it makes sense to use false/true rather than 0/1 for the select parameter. If not that, then perhaps a local enum { IsClass = 0, IsInstance };

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131210/43f27f11/attachment.html>


More information about the cfe-commits mailing list