<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 18, 2015 at 4:55 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Aug 18, 2015 at 4:40 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:Paul_Robinson@playstation.sony.com" target="_blank">Paul_Robinson@playstation.sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div><span>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal">How is this goal (adding imported modules for anonymous namespaces) consistent with the lack of imported modules for outer namespaces in nested ones? These two scenarios seem quite the same to me.<span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><a name="14f433d93a178107_14f432f507ad1d4a__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Sadly, the "lack of imported modules for outer namespaces in nested ones" is nothing more than the normal way scoping works everywhere (with two minor exceptions). </span></p></div></div></blockquote></span><div><br>Given DWARF's desire to be language neutral (does the DWARF spec talk about name lookup at all? I don't think the idea of searching outer namespaces is part of the DWARF spec, nor would it seem it should be... ) I would be surprised if the DWARF spec baked in one choice of lookup like this.<br> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">
 Therefore the scenarios are far from the same.  Searching upward from the current scope through the parents to the top is implicit and will remain so.  Even COBOL does that; it just doesn't make _all_ names visible to the inner scope.</span></p></div></div></blockquote></span><div><br>Perhaps I've misunderstood - how does it pick which names are visible?<br> </div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">For COBOL, I deliberately pretended the funky rules didn't exist. As far as DWARF is concerned, COBOL scoping works exactly like everything else.</span></p></div></div></blockquote><div><br></div></span><div>Doesn't that break the user experience (in the same way that the user experience for anonymous namespaces is broken for clients consuming Clang's debug info and not explicitly accounting for unnamed namespaces in some way)/make it inconsistent with the way name lookup works when using the language directly?</div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">For C++, adding explicit imports for anonymous namespaces means as far as DWARF is concerned, C++ scoping work exactly like everything else.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">That is: What I want will make all languages behave simply and consistently, for DWARF scoping purposes.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">Is that such an undesirable result?</span></p></div></div></blockquote><div><br></div></span><div>It's not a desirable result to me. (the COBOL example still seems like it's a counterproof of this, even if it were a desirable goal)</div></div></div></div></blockquote><div><br>I'll try to clarify/expound on this a bit: Scoping is only useful if you're doing sometihng with it, like name lookup. Given C++'s ADL, no consumer is going to be able to do language-agnostic consumption of C++ DWARF and get name lookup right, even if we patch this piece.<br><br>So far as I can tell, based on my (albeit comparatively limited) experience with DWARF is that DWARF itself offers a language agnostic encoding scheme that producers and consumers can use to traffic in language-specific information. Without knowing the language you're working with, DWARF is of limited value as there's too much underspecified (intentionally so) in the DWARF spec to make good use of the encoded information.<br><br>Yes, there are degrees of functionality that can be provided with degrees of language-specific knowledge (including zero-or-close-to-zero language-specific knowledge), but not much and it's not a hard line so far as I can see. <br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> </span><span style="color:rgb(31,73,125);font-family:Calibri,sans-serif;font-size:11pt">Still haven't heard anybody say what would *break* if we have explicit imports.</span></p></div></blockquote></span><div><br>We just add debug info where it's not needed. We usually try to avoid that, even if it's a small amount (which I'm sure it is), so far I don't agree with the motivation.<span class="HOEnZb"><font color="#888888"><br><br>- David</font></span></div></div></div></div>
</blockquote></div><br></div></div>