[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-03-06 Thread Alex Lorenz via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL297019: [Sema][ObjC] Warn about 'performSelector' calls with selectors (authored by arphaman). Changed prior to commit: https://reviews.llvm.org/D30174?vs=90473=90709#toc Repository: rL LLVM

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-03-05 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak accepted this revision. ahatanak added a comment. This revision is now accepted and ready to land. Looks good, thanks! Repository: rL LLVM https://reviews.llvm.org/D30174 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-03-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman updated this revision to Diff 90473. arphaman marked 3 inline comments as done. arphaman added a comment. The updated diff: - Warns for vector types. - Addresses Akira's comments. Repository: rL LLVM https://reviews.llvm.org/D30174 Files:

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-03-03 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman marked 3 inline comments as done. arphaman added inline comments. Comment at: lib/AST/DeclObjC.cpp:987 unsigned noParams = param_size(); if (noParams < 1 || noParams > 3) family = OMF_None; ahatanak wrote: > It seems like this

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-21 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. I'm not sure how common it is to pass a function that doesn't return an object or void, I think it's OK to allow returning primitive types if you think being too strict would catch too many false positives. Comment at: lib/AST/DeclObjC.cpp:987

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-21 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D30174#681890, @ahatanak wrote: > In https://reviews.llvm.org/D30174#681843, @arphaman wrote: > > > Yes, we do. Primarily for the following reason: even if some target may > > return a struct in a register, another target isn't guaranteed to

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. In https://reviews.llvm.org/D30174#681843, @arphaman wrote: > Yes, we do. Primarily for the following reason: even if some target may > return a struct in a register, another target isn't guaranteed to do the same > thing. It's better to always warn about this rather

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman added a comment. In https://reviews.llvm.org/D30174#681801, @ahatanak wrote: > Do we still issue a warning even when the struct can be returned in a > register? For example, x86 can return a small struct (for example, a struct > with one int field) in a single register, in which case

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Akira Hatanaka via Phabricator via cfe-commits
ahatanak added a comment. Do we still issue a warning even when the struct can be returned in a register? For example, x86 can return a small struct (for example, a struct with one int field) in a single register, in which case it's fine to pass it to performSelector via @selector. If we

[PATCH] D30174: [Sema][ObjC] Warn about 'performSelector' calls with selectors that return record types

2017-02-20 Thread Alex Lorenz via Phabricator via cfe-commits
arphaman created this revision. The `performSelector` family of methods from Foundation use `objc_msgSend` to dispatch the selector invocations to objects. However, method calls to methods that return record types might have to use the `objc_msgSend_stret` as the return value won't find into