[LLVMdev] Questions before moving the new debug info hierarchy into place

Duncan P. N. Exon Smith dexonsmith at apple.com
Fri Feb 20 12:41:14 PST 2015


> On 2015-Feb-20, at 11:04, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
> 
>> 
>> On 2015-Feb-20, at 09:00, David Blaikie <dblaikie at gmail.com> wrote:
>> 
>> 
>> 
>> On Thu, Feb 19, 2015 at 7:49 PM, Duncan P. N. Exon Smith <dexonsmith at apple.com> wrote:
>> 
>> Merging the two types of files
>> ==============================
>> 
>> In the old format, we have two types of files -- an untagged file node,
>> and a DIFile/DW_TAG_file_type/0x29 which references the untagged node.
>> 
>>    !0 = !{!"path/to/file", !"/path/to/dir"}
>>    !1 = !{!"0x29", !0}
>> 
>> In the actual metadata graph, most file references use !0, but in
>> DIBuilder !1 is always passed in and the !0 is extracted from it.
>> 
>> I've been planning to merge these into:
>> 
>>    !1 = !MDFile(filename: "path/to/file", directory: "/path/to/dir")
>> 
>> Anyone see a problem with that?  Why?
>> 
>> If the strings are deduplicated elsewhere, that should be fine. (I think I made the change originally to pull out the names because of the duplication I saw in many constructsn needing to reference the file/directory and they all contained the same file/directory)
> 
> Yup, they'll be de-duped via `MDFile`.
> 
>> I take it you'll have other constructs (I think all scopes have a file/directory) reference the MDFile directly?
> 
> I'll make it so all `file:` references point to an `MDFile`; so
> far this is only true for `MDCompileUnit` (the others point to
> the untagged node).  There are some places (at least in
> testcases) where `MDFile` is being used in a `scope:` reference;
> I'll leave those unchanged (although IIUC, Adrian thinks a file
> should never be used as a scope -- you always have a better
> option (compile unit, namespace, etc.) -- so maybe that'll be
> changing eventually... we just need be mindful of type uniquing).
> 
>> 
>> 
>> If not, I'd like to roll that change into the same patch in order to
>> reduce testcase churn.  (I've discovered that it won't complicate the
>> code patch at all.)

Committed the changes to `MDFile` in r230057 (`DIFile` and testcase
upgrading will be rolled into the "transition" patch).





More information about the llvm-dev mailing list