]> granicus.if.org Git - clang/commit
Lazy loading of builtins for precompiled headers.
authorDouglas Gregor <dgregor@apple.com>
Wed, 22 Apr 2009 18:49:13 +0000 (18:49 +0000)
committerDouglas Gregor <dgregor@apple.com>
Wed, 22 Apr 2009 18:49:13 +0000 (18:49 +0000)
commit2deaea37a637dd01221d0cced343702a39d8132c
treeece1730c3fad98b022a242caf6f2e2b6933836e2
parent404dd7afe15c9d8b614da031bbfae6a28ffaea72
Lazy loading of builtins for precompiled headers.

PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
  286/20693 types read (1.382110%)
  1630/59230 declarations read (2.751984%)
  764/44914 identifiers read (1.701029%)
  1/32954 statements read (0.003035%)
  5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
  411/20693 types read (1.986179%)
  2553/59230 declarations read (4.310316%)
  1093/44646 identifiers read (2.448148%)
  1/32954 statements read (0.003035%)
  21/6187 macros read (0.339421%)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69815 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
include/clang/AST/Builtins.h
include/clang/Frontend/PCHWriter.h
lib/AST/ASTContext.cpp
lib/AST/Builtins.cpp
lib/Frontend/PCHReader.cpp
lib/Frontend/PCHWriter.cpp
tools/clang-cc/clang-cc.cpp