[PATCH]: Add a flag to the DWARF Compile Unit to indicate if it was compiled with ARC

Eric Christopher echristo at gmail.com
Mon May 13 13:44:30 PDT 2013


On Mon, May 13, 2013 at 1:25 PM, Adrian Prantl <aprantl at apple.com> wrote:
>
> On May 13, 2013, at 11:57 AM, Eric Christopher <echristo at gmail.com> wrote:
>
>> Eh? Curious what this will be used for?
> This would be interesting mostly for the debugger but I guess tools like Instruments would also like to know.

In what way? I.e. why add it?

>> Couple of alternate implementation thoughts:
>>
>> a) Collect this with isOptimized to provide compile unit flags
>
> You mean something like
> enum CompileUnitFlags {
>   optimized = 1,
>   arc = 2
> }
> all or’ed together in an Int8Ty that replaces the two Int1Tys in the CompileUnit MDNode?
> That has the advantage that the number of fields in a CU MDNode remains the same as we add more flags, but it’s still incompatible with the current layout. I personally find the 1bit fields slightly more elegant, but I don’t feel strong about it.

Yeah, until you get a lot of them. I'd rather this if we need a flag.
I still want to know why we need the flag though.

>
>> b) Add a new part to the language enum that is ObjCWithArc or some
>> better naming and then lower that appropriately in the backend
>
> I thought about this before, but then I would also need to add an ObjCxxWithArc, which makes the single extra flag look like the better solution.
>

It is a language variant, similar to, say, c++11/c++14. Which is why I
was wondering why we need this - other language extensions etc do
pretty well with new tags/attributes.

-eric




More information about the llvm-commits mailing list