[cfe-dev] ARC + array literal patch feedback request

Jesse Rusak me at jesserusak.com
Fri Mar 22 16:02:38 PDT 2013

On 2013-03-22, at 6:45 PM, John McCall <rjmccall at apple.com> wrote:

> On Mar 20, 2013, at 10:41 AM, Jesse Rusak <me at jesserusak.com> wrote:
>> Thanks for the detailed response; this makes a lot of sense to me. So, clang.arc.use_objects is a non-existent function which is removed after the main ARC optimizer runs, but the use of those objects is sufficient to prevent ARC from moving the release up. I'll try this out and put together a patch.
> I've actually done the LLVM side of this as r177769, although the function is named @clang.arc.use now.

Ah, great. I had something similar coming together, but I had two concerns that I was still working through:

First, I think the ARC contract phase only runs under -O1 or higher, so calls to @clang.arc.use will remain under -O0 and cause link-time errors. I was thinking of either changing EmitAssemblyHelper::AddEmitPasses to always include the contract pass, or else move the erasure logic elsewhere (perhaps to a new, later ARC pass). 

Second, I was also concerned with the interpreter, which seems to use IntrinsicLowering to evaluate intrinsics; do we need to add some logic to IntrinsicLowering::LowerIntrinsicCall to handle this function?

The other option which might solve both of these is to make this a "real" LLVM intrinsic and give it an empty body. 

Let me know if you have any thoughts about the above; I was planning on finishing up a first patch this weekend. 


More information about the cfe-dev mailing list