[PATCH] Add target independent attribute for ObjCARC

Michael Gottesman mgottesman at apple.com
Thu May 16 22:10:23 PDT 2013


On May 16, 2013, at 9:27 PM, Chris Lattner <clattner at apple.com> wrote:

> 
> On May 16, 2013, at 5:58 PM, Michael Gottesman <mgottesman at apple.com> wrote:
> 
>> Hey Bill!
>> 
>> The attached patch adds a target independent attribute for ObjCARC.
> 
> Why?

Some context:
\context
We always run a certain ARC cleanup pass (ObjCARCContract) before codegen on code compiled with ARC. This creates a thorny issue when one is using LTO since we support the ability to mix MRR and ARC code together and we do not want to run ObjCARCContract on MRR code. The solution to this is to use Bill's attribute work to put an attribute on functions compiled in modules with ARC enabled and only run said pass during LTO codegen on functions which have said attribute. Thus we can mix/match modules that use ARC and those that use MRR.
\end context

I have a patch on cfe-commits which adds this functionality as a string attribute (i.e. "objc-arc"). Bill suggested that I implement it as a target independent attribute (i.e. objcarc) implying this patch. I have no strong opinions here. As such if you have strong feelings about this, I have no problem using the string attribute. = ).

Michael

> 
> -Chris




More information about the llvm-commits mailing list