<div class="gmail_quote">On Mon, Mar 12, 2012 at 8:12 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard-llvm@metafoo.co.uk">richard-llvm@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: rsmith<br>
Date: Mon Mar 12 22:12:56 2012<br>
New Revision: 152608<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=152608&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=152608&view=rev</a><br>
Log:<br>
Fix PR10447: lazily building name lookup tables for DeclContexts was broken.<br>
The deferred lookup table building step couldn't accurately tell which Decls<br>
should be included in the lookup table, and consequently built different tables<br>
in some cases.<br>
<br>
Fix this by removing lazy building of DeclContext name lookup tables. In<br>
practice, the laziness was frequently not worthwhile in C++, because we<br>
performed lookup into most DeclContexts. In C, it had a bit more value,<br>
since there is no qualified lookup.<br>
<br>
In the place of lazy lookup table building, we simply don't build lookup tables<br>
for function DeclContexts at all. Such name lookup tables are not useful, since<br>
they don't capture the scoping information required to correctly perform name<br>
lookup in a function scope.<br>
<br>
The resulting performance delta is within the noise on my testing, but appears<br>
to be a very slight win for C++ and a very slight loss for C. The C performance<br>
can probably be recovered (if it is a measurable problem) by avoiding building<br>
the lookup table for the translation unit.<br></blockquote><div><br></div><div>I should have mentioned: we had a modules test which only passed if the lookup table for one of its namespaces happened to be built lazily. The current failures were easy to trigger before, by making seemingly-unrelated changes to the test which forced the lookup table to be built. That test is now XFAIL'd.</div>
<div><br></div><div>- Richard</div></div>