[cfe-commits] r152608 - in /cfe/trunk: include/clang/AST/DeclBase.h lib/AST/DeclBase.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaDeclObjC.cpp lib/Sema/SemaLookup.cpp lib/Sema/SemaObjCProperty.cpp lib/Sema/SemaTemplate.cpp lib/

Richard Smith richard at metafoo.co.uk
Mon Mar 12 20:22:04 PDT 2012

On Mon, Mar 12, 2012 at 8:12 PM, Richard Smith
<richard-llvm at metafoo.co.uk>wrote:

> Author: rsmith
> Date: Mon Mar 12 22:12:56 2012
> New Revision: 152608
> URL: http://llvm.org/viewvc/llvm-project?rev=152608&view=rev
> Log:
> Fix PR10447: lazily building name lookup tables for DeclContexts was
> broken.
> The deferred lookup table building step couldn't accurately tell which
> Decls
> should be included in the lookup table, and consequently built different
> tables
> in some cases.
> Fix this by removing lazy building of DeclContext name lookup tables. In
> practice, the laziness was frequently not worthwhile in C++, because we
> performed lookup into most DeclContexts. In C, it had a bit more value,
> since there is no qualified lookup.
> In the place of lazy lookup table building, we simply don't build lookup
> tables
> for function DeclContexts at all. Such name lookup tables are not useful,
> since
> they don't capture the scoping information required to correctly perform
> name
> lookup in a function scope.
> The resulting performance delta is within the noise on my testing, but
> appears
> to be a very slight win for C++ and a very slight loss for C. The C
> performance
> can probably be recovered (if it is a measurable problem) by avoiding
> building
> the lookup table for the translation unit.

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.

- Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120312/a5dc772a/attachment.html>

More information about the cfe-commits mailing list