ObjFW runtime: Add objc_msg_lookup(_super)_{fp,st}ret

Eli Friedman eli.friedman at gmail.com
Wed Jul 10 18:46:09 PDT 2013

On Wed, Jul 10, 2013 at 4:08 PM, Jonathan Schleifer <js at webkeks.org> wrote:
> Am 09.07.2013 um 03:37 schrieb Eli Friedman:
>> On the other hand, if you care about Objective-C++, you might want to
>> check the behavior for a selector returning a class with a non-trivial
>> copy constructor.
> Can you elaborate on what special cases I need to consider for copy constructors? Doesn't it work from the ABI-side just like a struct return?

It's returned in a different kind of temporary, so the ABI code
doesn't consider it "stret".

>> Okay.  Granted, you probably need to add the handling for non-integer
>> messages in a followup; the current code that does this on the Mac is
>> in Mac-specific code.
> Yes, I planned to do that as a follow-up patch.
>> This needs a regression test for both the objfw and non-objfw cases.
>> (Sorry, I didn't realize it was missing before.)
> Sorry, I always forget the tests :(. I already promised John McCall to better myself, yet I forget again. Shame on me!
> Please see the attached patch which now includes tests (I hope I did it right, it's the first time I wrote a test). It also includes a new __has_feature called objc_msg_lookup_stret to test if forwarding on stret is safe.

Missing documentation patch for the __has_feature.  Also, not sure I
like the name; can you try for something more descriptive?

You can combine the two tests into one using FileCheck's -check-prefix flag.


More information about the cfe-commits mailing list