Patch for Bug 30413, including test case

Lobron, David via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 10 06:44:16 PST 2017


Hi Akira,

Thank you very much!  Please let me know if I need to take any further steps beyond this email to cfe-commits in order for the patch and the unit test to be committed.

Thanks,

David

> On Mar 9, 2017, at 4:46 PM, Akira Hatanaka <ahatanaka at apple.com> wrote:
> 
> Hi David,
> 
> The patch looks good to me.
> 
>> On Mar 9, 2017, at 1:01 PM, Lobron, David <dlobron at akamai.com> wrote:
>> 
>> Hi Akira,
>> 
>>> My concern is that the patch changes the encoding of @encode(id<NSObject>) on Darwin, which I think isn’t what you are trying to fix. If you compile the following code with command “clang -cc1 -triple x86_64-apple-macosx”, the type encoding changes after applying the patch.
>>> 
>>> const char *foo() {
>>> return @encode(id<NSObject>);
>>> }
>>> 
>>> It seems like you can fix your problem without affecting Darwin by passing an extra argument to getObjCEncodingForType, just like CGObjCCommonMac::GetMethodVarType does.
>> 
>> Ah, thanks- I understand now.  Yes, this change seems a lot safer, and I verified that it passes my test.  I've attached my new patch file, and I've also attached the test again.  Please let me know if this works for you or if you think it needs any additional work.
>> 
>> --David
>> 
>> <CGObjCGNU.cpp.patch><ivar-type-encoding.m>
> 



More information about the cfe-commits mailing list