hanchenye-llvm-project/clang/test
Douglas Gregor 935bc7a214 Make the loading of information attached to an IdentifierInfo from an
AST file more lazy, so that we don't eagerly load that information for
all known identifiers each time a new AST file is loaded. The eager
reloading made some sense in the context of precompiled headers, since
very few identifiers were defined before PCH load time. With modules,
however, a huge amount of code can get parsed before we see an
@import, so laziness becomes important here.

The approach taken to make this information lazy is fairly simple:
when we load a new AST file, we mark all of the existing identifiers
as being out-of-date. Whenever we want to access information that may
come from an AST (e.g., whether the identifier has a macro definition,
or what top-level declarations have that name), we check the
out-of-date bit and, if it's set, ask the AST reader to update the
IdentifierInfo from the AST files. The update is a merge, and we now
take care to merge declarations before/after imports with declarations
from multiple imports.

The results of this optimization are fairly dramatic. On a small
application that brings in 14 non-trivial modules, this takes modules
from being > 3x slower than a "perfect" PCH file down to 30% slower
for a full rebuild. A partial rebuild (where the PCH file or modules
can be re-used) is down to 7% slower. Making the PCH file just a
little imperfect (e.g., adding two smallish modules used by a bunch of
.m files that aren't in the PCH file) tips the scales in favor of the
modules approach, with 24% faster partial rebuilds.

This is just a first step; the lazy scheme could possibly be improved
by adding versioning, so we don't search into modules we already
searched. Moreover, we'll need similar lazy schemes for all of the
other lookup data structures, such as DeclContexts.

llvm-svn: 143100
2011-10-27 09:33:13 +00:00
..
ARCMT Further refine the diagnostic categories for ARC diagnostics. Addresses <rdar://problem/10245086>. 2011-10-20 05:07:47 +00:00
ASTMerge Improve location fidelity of objc decls. 2011-10-04 04:48:02 +00:00
Analysis Add source-level dominators analysis. Patch by Guoping Long! 2011-10-25 00:25:24 +00:00
CXX Compute the promoted integer type of fixed-width enums correctly. Found by inspection. 2011-10-26 07:38:19 +00:00
CodeCompletion Provide result types for code completions that describe built-in 2011-10-18 21:20:17 +00:00
CodeGen Move these test from checking assembly to checking LLVM IR. Should fix fallout 2011-10-27 07:11:43 +00:00
CodeGenCUDA CUDA: IR generation support for device stubs 2011-10-06 18:51:56 +00:00
CodeGenCXX Move these test from checking assembly to checking LLVM IR. Should fix fallout 2011-10-27 07:11:43 +00:00
CodeGenObjC Move these test from checking assembly to checking LLVM IR. Should fix fallout 2011-10-27 07:11:43 +00:00
CodeGenObjCXX obj-c++: Fix a IRGen crash when getter is a reference type. 2011-10-17 21:00:22 +00:00
CodeGenOpenCL PTX: Set proper calling conventions for PTX in OpenCL mode. 2011-10-05 17:58:44 +00:00
Coverage Remove the Blackfin backend. 2011-10-25 00:06:12 +00:00
Driver test/Driver/debug.c: Mark this as "REQUIRES: shell". 2011-10-22 11:28:32 +00:00
FixIt Make the -verify bits in this test actually test something, and fix a few cases 2011-10-20 01:41:28 +00:00
Frontend Frontend: Support -iframework. 2011-10-18 20:40:38 +00:00
Headers Remove __WCHAR_UNSIGNED__ and anything that used it. 2011-09-20 18:05:01 +00:00
Index Disalbe more Microsoft-specific stuff. 2011-10-26 23:19:04 +00:00
Lexer Make the -Wc++11-compat warnings ignored by default, so we don't break 2011-10-25 03:07:45 +00:00
Misc Switch to a more natural formatting of the macro name printing. 2011-10-24 18:51:08 +00:00
Modules Make the loading of information attached to an IdentifierInfo from an 2011-10-27 09:33:13 +00:00
PCH Disable on Windows, for real. 2011-10-26 14:35:30 +00:00
Parser Improve the diagnostic when a comma ends up at the end of a declarator group 2011-10-19 21:33:05 +00:00
Preprocessor Remove more SystemZ (s390) tests. 2011-10-25 00:15:21 +00:00
Rewriter Fix the rewriter, rdar://10234024. 2011-10-05 19:37:56 +00:00
Sema Teach format string analysis that "%zu" means size_t. 2011-10-27 08:29:09 +00:00
SemaCUDA CUDA: diagnose invalid calls across targets 2011-10-02 23:49:40 +00:00
SemaCXX UnresolvedMemberExprs need lvalue-to-rvalue conversions during template 2011-10-26 06:15:36 +00:00
SemaObjC Fix crash on an @interface nested inside @implementation, rdar://10336158 2011-10-27 00:09:34 +00:00
SemaObjCXX Restore r142914 and r142915, now with missing file and apparent 2011-10-25 17:37:35 +00:00
SemaOpenCL The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also 2011-10-17 21:00:38 +00:00
SemaTemplate Fix crash due to missing array-to-pointer decay when instantiating an unresolved 2011-10-26 06:49:26 +00:00
Unit test/Unit: Fixup lit.cfg to allow running inside test/Unit (with llvm-config in 2011-06-22 21:46:43 +00:00
CMakeLists.txt CUDA: set proper calling conventions for PTX 2011-10-06 16:49:54 +00:00
Makefile lit support for REQUIRES: asserts. 2011-06-22 23:23:49 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg FreeBSD (apparently) does not support crash-recovery tests. 2011-08-26 22:46:31 +00:00
lit.site.cfg.in lit support for REQUIRES: asserts. 2011-06-22 23:23:49 +00:00
make_test_dirs.pl