<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 28, 2021 at 7:52 AM Jeremy Morse <<a href="mailto:jeremy.morse.llvm@gmail.com">jeremy.morse.llvm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
David wrote:<br>
> We should never produce DWARF like this:<br>
<br>
A patch to achieve that: <a href="https://reviews.llvm.org/D95617" rel="noreferrer" target="_blank">https://reviews.llvm.org/D95617</a><br>
<br>
On Thu, Jan 28, 2021 at 10:19 AM Djordje Todorovic<br>
<<a href="mailto:Djordje.Todorovic@syrmia.com" target="_blank">Djordje.Todorovic@syrmia.com</a>> wrote:<br>
> IMPO, this works intuitively, but if you think that we should handle 2) case in some other way (e.g. just to ignore such parameter), please let me know.<br>
<br>
As far as I understand it, we shouldn't be counting the number of<br>
variables "processed", and instead be counting:<br>
* The total number of variables for each scope, by using the inlined<br>
subprograms abstract origins to find in-scope variables that have no<br>
location,<br>
* The number of concrete variables that have a DW_AT_location<br>
<br>
The first number should remain stable regardless of how well we do at<br>
tracking variable locations.<br></blockquote><div><br>Yep, +1 to that.<br><br>Said another way, the presence or absence of an inline variable/formal_parameter with only an abstract_origin should not change the answer. And more specifically, the coverage shouldn't go /down/ when we add a single byte of location information to a variable that was previously uncovered. That variable having no coverage should already be recorded in the stats (which it isn't currently, as I understand it). To do this, as Jeremy said - we should go searching for variables in the abstract DIE tree, even if they don't appear in the inlined tree.<br><br>(I'm /vaguely/ remembering some particular issue with matching up inlined scope entities to their abstract origin... maybe something about inlined scopes that needed to be emitted/had entities in them even when they were zero length or something... but I can't quite recall right now. Oh well)<br><br>- Dave</div></div></div>