<div dir="ltr">On 20 June 2013 23:04, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>Not really - the backend doesn't really know when/how to make that<br></div>
choice & just because we've optimized away all the code is no reason<br>
not to emit it. (& types especially don't necessarily connect to any<br>
code - or at least not in any way that is easily distinguishable<br>
between declaration and definition type uses).<br></blockquote><div><br></div><div style>I'm quite likely being too shallow in my analysis, but IIRC, types in metadata are nodes that get created when a variable or structure is defined, so you can point the uses and declarations to it. This is why you want to cache them, to have the same type metadata for all uses, or you'd end up with many different "INT" types and so on.</div>
<div style><br></div><div style>If the last user unlinks against a type, it means that type is unused, so when emitting the Dwarf table you only emit the types with use count > 0. Each compile unit can remove unused types (if they come from a header or forward declaration), since other CUs will have them anyway, and when you link them all together, assuming name mangling is universal, it should just click.</div>
<div style><br></div><div style>But that's probably wrong... ;)</div><div style><br></div><div style>cheers,</div><div style>--renato</div><div style><br></div><div style><br></div></div></div></div>