<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 6, 2015, at 3:24 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, May 6, 2015 at 3:15 PM, Adrian Prantl <span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><blockquote type="cite" class=""><span class=""><div class="">On May 6, 2015, at 2:52 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank" class="">dblaikie@gmail.com</a>> wrote:</div><br class=""></span><div class=""><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote"><span class="">On Wed, May 6, 2015 at 2:45 PM, Adrian Prantl <span dir="ltr" class=""><<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>></span> wrote:<br class=""></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><br class=""><div class=""><span class=""><span class=""><blockquote type="cite" class=""><div class="">On May 6, 2015, at 2:35 PM, Eric Christopher <<a href="mailto:echristo@gmail.com" target="_blank" class="">echristo@gmail.com</a>> wrote:</div></blockquote></span></span><span class=""><span class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_quote"><div class=""><br class=""></div><div class="">That said, add enough to the name for hashing purposes to make it hash uniquely? Or you can go down the path of hashing the type similar to the fission CU hashing (which is what type units were arguably designed to do in the first place if you take a look at the standard, we just only use them for ODR compliant languages etc right now).</div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">I suppose one could hash the entire module configuration + the mangled name and get something that is relatively stable.</div><div class="">For implementation reasons it would be terrible to do the full fission hashing because that would mean that we would actually have to look up (and deserialize the type) in order to get to its ID when emitting an external type reference, which would void at least some of the performance gains we want from module debugging.</div></span></div></div></blockquote><span class=""><div class=""><br class="">I thought you were proposing using the mangled name of the type for the identifier anyway? Perhaps I misunderstood - what are you proposing to use? In any case, I'd prefer to see whatever it is hashed and used as the type unit signature for compatibility with DWARF5, rather than adding an extra/separate/new/non-standard way to do cross-unit/cross-fission type references.<br class=""></div></span></div></div></div></div></blockquote><div class=""><br class=""></div><div class="">In the IR I’d /like/ to have a DIExternalTypeRef(DW_TAG_class_type, !”_ZTC6TypeName”, !1) with !1 being a reference to either the DIModule or the skeleton CU. Then the backend would emit the hash of the name if type units are enabled (C++/gdb) or the mangled name (+ the accelerator table entry) otherwise (ObjC and/or Darwin). If there is significant pushback to the latter, I’d be willing to have the backend emit a hash in both cases but we’d have to careful about what to exactly to hash for all the aforementioned reasons.</div></div></div></blockquote><div class=""><br class="">I don't follow - if the mangled name is sufficient, then a hash of the mangled name should be.... what am I missing?<br class=""><br class=""></div></div></div></div></div></blockquote><div><div>Nothing, these are two separate issues:</div><div class=""><br class=""></div></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class="">If you don't have an ODR to rely on, then a mangled name seems insufficient just as the hash would be.<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>The decision for mangled name vs hash is motivated by the mangled name also doubling as a key to look up the type in the AST.</div><div>The other problem is (partially) solved by the accelerator table entry that associates the mangled name with a module. I’m starting to think now that it might be better to include a fission-style forward declaration + decl context into the TAG_module instead. The DWARF-style decl context could in theory be smaller than the mangled name because two types could share common ancestors and then we could emit the same hash of the mangled names as we do for type units. But let’s discuss this when it comes up (together with the patch that makes use of DIExternalTypeRef).</div><div><br class=""></div><div>-- adrian</div><div><br class=""></div></div></body></html>