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

Adrian Prantl aprantl at apple.com
Mon May 13 13:25:13 PDT 2013


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.
> 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.

> 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.

cheers,
Adrian



More information about the llvm-commits mailing list