diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-26 03:49:13 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-26 03:49:13 +0000 |
commit | 1970d887abb9b154658e64f37bb514135a0ace6d (patch) | |
tree | 4d466bc0755848a15205256d5ec2cf25d1e5b305 /clang/lib/Frontend/PCHReader.cpp | |
parent | 32887f0274cbb332f344a19b91d12b58eeaca637 (diff) | |
download | bcm5719-llvm-1970d887abb9b154658e64f37bb514135a0ace6d.tar.gz bcm5719-llvm-1970d887abb9b154658e64f37bb514135a0ace6d.zip |
When writing a PCH file, write multiple type and declaration blocks as
necessary and iterate until all types and declarations have been
written. This reduces the Cocoa.h PCH file size by about 4% (since we
don't write types we don't need), and fixes problems where writing a
declaration generates a new type.
This doesn't seem to have any impact on performance either way.
llvm-svn: 70109
Diffstat (limited to 'clang/lib/Frontend/PCHReader.cpp')
-rw-r--r-- | clang/lib/Frontend/PCHReader.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 9970eb2b090..0407ed89968 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -2563,6 +2563,7 @@ QualType PCHReader::GetType(pch::TypeID ID) { } Index -= pch::NUM_PREDEF_TYPE_IDS; + assert(Index < TypesLoaded.size() && "Type index out-of-range"); if (!TypesLoaded[Index]) TypesLoaded[Index] = ReadTypeRecord(TypeOffsets[Index]).getTypePtr(); |