diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-27 20:06:05 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-27 20:06:05 +0000 |
commit | b81c17092039f39be60e9656a37cffbdf2e2c783 (patch) | |
tree | 07cebe7f2ae9fda0f1b532dfde1006bcebaef540 /lib/Frontend/PCHWriter.cpp | |
parent | c6a59e4bf225c7f8152faca72897321f0f6cabd1 (diff) |
Add Sema::ExtVectorDecls and Sema::ObjCCategoryImpls to the PCH file. Since these vectors are very, very rarely used and, when used in headers, and even when used are relatively small, we load them eagerly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70240 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 8ff688e6e3..817893448a 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -355,6 +355,8 @@ void PCHWriter::WriteBlockInfoBlock() { RECORD(SOURCE_LOCATION_OFFSETS); RECORD(SOURCE_LOCATION_PRELOADS); RECORD(STAT_CACHE); + RECORD(EXT_VECTOR_DECLS); + RECORD(OBJC_CATEGORY_IMPLEMENTATIONS); // SourceManager Block. BLOCK(SOURCE_MANAGER_BLOCK); @@ -1656,6 +1658,17 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls) { TD != TDEnd; ++TD) AddDeclRef(TD->second, LocallyScopedExternalDecls); + // Build a record containing all of the ext_vector declarations. + RecordData ExtVectorDecls; + for (unsigned I = 0, N = SemaRef.ExtVectorDecls.size(); I != N; ++I) + AddDeclRef(SemaRef.ExtVectorDecls[I], ExtVectorDecls); + + // Build a record containing all of the Objective-C category + // implementations. + RecordData ObjCCategoryImpls; + for (unsigned I = 0, N = SemaRef.ObjCCategoryImpls.size(); I != N; ++I) + AddDeclRef(SemaRef.ObjCCategoryImpls[I], ObjCCategoryImpls); + // Write the remaining PCH contents. RecordData Record; Stream.EnterSubblock(pch::PCH_BLOCK_ID, 4); @@ -1727,6 +1740,14 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls) { if (!LocallyScopedExternalDecls.empty()) Stream.EmitRecord(pch::LOCALLY_SCOPED_EXTERNAL_DECLS, LocallyScopedExternalDecls); + + // Write the record containing ext_vector type names. + if (!ExtVectorDecls.empty()) + Stream.EmitRecord(pch::EXT_VECTOR_DECLS, ExtVectorDecls); + + // Write the record containing Objective-C category implementations. + if (!ObjCCategoryImpls.empty()) + Stream.EmitRecord(pch::OBJC_CATEGORY_IMPLEMENTATIONS, ObjCCategoryImpls); // Some simple statistics Record.clear(); |