Unavailable method checker

Richard tarka.t.otter at gmail.com
Sun Oct 27 06:55:41 PDT 2013

On 25 Oct 2013, at 18:51, Jordan Rose <jordan_rose at apple.com> wrote:

>>> +        const ObjCSelectorExpr *SelExpr = cast<ObjCSelectorExpr>(ME->getArg(0));
>>> This could fail if the user passes a SEL variable.
>> Well spotted. I have added a helper method to extract the ObjCSelectorExpr in the case of a SEL variable, it is very ugly code though, is there an easier way to do this? see selectorForArgument().
> The way you've done it will break for re-assignments, so that won't work. I think the right thing to do is just ignore that case for now; in the long term, I think the correct solution is to model SEL regions in the same sort of way as we do string literals.

OK, I removed the code and replaced it with a TODO for now.

> I'm still concerned about the diagnostic text:
> +  os << "Calling method introduced in ";
> +  os << Introduced;
> +  os << " (deployment target is ";
> +  os << deploymentTarget(State);
> +  os << ")";
> At the very least we need to distinguish "method" and "function"; for bonus points, saying that the entire class or protocol was introduced in version X would be nice polish.
> Jordan

How about the attached patch? It prints the class or protocol version when the method has no specific introduced version.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: unavailable-2710.patch
Type: application/octet-stream
Size: 18658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131027/e84cd0c2/attachment.obj>

More information about the cfe-commits mailing list