<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 14, 2016 at 8:39 AM Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">clayborg added a comment.<br class="gmail_msg">
<br class="gmail_msg">
In <a href="https://reviews.llvm.org/D26567#594381" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26567#594381</a>, @probinson wrote:<br class="gmail_msg">
<br class="gmail_msg">
> So the idea is that you don't always have a Unit when you're parsing the abbreviations?  That's mildly counter-intuitive.  If you have a Unit then you know version and format up front, and you can just calculate the fixed sizes without having to remember how many of which special cases you found.  When would you be doing this without a Unit available?<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
All DWARF that we deal with in Mach-O at Apple have one abbreviation table that is shared for all compile units. Not sure if this is how things end up being in ELF DWARF files, but our tools end up having one abbreviation table for all compile units.<br class="gmail_msg"></blockquote><div><br></div><div>Having a many-to-1 mapping between units and abbreviations can happen in ELF (I think we do that in LLVM - we produce one abbrev table for all units we emit (so, with type units enable the CU + all type units share an abbrev table, and with LTO all the CUs share an abbrev table))<br><br>But that shouldn't change the need to have a unit when parsing abbrevs - if you do it lazily when you visit a unit "have I already parsed this abbrev table" then you could efficiently share abbrev tables across however many units use the same abbrev table without having to parse it into a context-agnostic representation (if I'm following the discussion here).<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D26567" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D26567</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div></div>