<div dir="ltr"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Do you object to anything I proposed other than removing the<br>
representation of the anonymous class compilers generate for lambdas?<br></blockquote><div><br>I'm not a /super/ fan of introducing a bunch of locals in addition to the member descriptions - it'll be a bunch of extra DWARF that'd be nice to avoid if we can...<br><br>But putting object_pointer on the class member that stores "this" seems problematic since that's effectively at the same scope as the real object pointer - it'd be awkward to say there's two "this" at the same scope and have to say that the member variable "this" shadows the real "this" in some way.<br><br>And then you want the captured variables to be in a scope that is inside the "this" scope so they override unqualified lookup for any names that are also members of "this"... <br><br>So, yeah, I get why you/gcc developers arrived where they did. I wouldn't mind some size analysis to see how bad the regression/cost is, that might help inform whether it's worth trying to address it.<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Because that's not really essential to what I want to do if we're fine<br>
with DW_AT_object_pointer pointing to a variable that doesn't share a<br>
containing type.<br></blockquote><div><br></div><div>Yeah, this general idea I think I'm down with - if it generalizes to scope-based "this" in other languages/features, etc, that seems good.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Now that I've thought about it a bit more I think that is not<br>
particularly weird. Rust for example allows<br>
<br>
fn member(self: Rc<Self>, arg1: Foo, ...)<br>
<br>
where the type of the receiver can be certain things that are<br>
convertible to the containing object but are definitely not the<br>
containing object. rustc doesn't emit DW_AT_object_pointer today but<br>
it should.<br>
<br>
- Kyle<br>
<br>
<br>
> Introducing a bunch of locals that expose the right names/types - seems OK to me.<br>
><br>
> Using object_pointer to refer to a local "this" could have other uses too - some languages (I forget which ones) have a scope based object usage, like "foo f; f.x();" -> "using (foo f) { x(); }" and so using object_pointer on the scope to refer to the local could be used to support that feature.<br>
<br>
- Kyle<br>
</blockquote></div></div>