[LLVMdev] [RFC] Less memory and greater maintainability for debug info IR

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Oct 13 16:39:34 PDT 2014


> On Oct 13, 2014, at 3:47 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> On Mon, Oct 13, 2014 at 3:37 PM, Reid Kleckner <rnk at google.com> wrote:
>> I think making debug info more of a first-class IR citizen is probably the way to go. Right now debug info is completely unreadable and is downright opposed to the design goals of the IR as I understand them.
> 
> I'm still not sure this would produce particularly more legible, let alone writeable, debug info IR. It's possible, certainly, if the schema was baked into IR reading and writing, that we could pretty print it with annotated field names and allow writing the debug info with omitted fields (because the parser would know that this was, say, a subprogram record, and be able to reorder fields to the required schema or add default values for omitted fields), but I'm not sure we'd get that far nor whether it would really tip debug info to the point of writeability - it's still necessarily a format that describes code, which tends towards being more ungainly than the code itself. ("this thing is on line 42" rather than "thing" written on line 42)
> 

Personally, I find this:

    !7 = metadata !MDLineTable(line: 45, column: 7, scope: !9)

significantly more readable (and writeable) than this:

    !7 = metadata !{i32 45, i32 7, metadata !9, null}

The gains are even greater for the DIDescriptors, which have more
operands and are more connected.

Or have I missed your point?



More information about the llvm-dev mailing list