diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-23 19:11:11 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-23 19:11:11 +0000 |
commit | 320198303df7c16950d83ae79c3f702b84badcf7 (patch) | |
tree | 04296f2796785541c5ddb347e31c84c3a8692707 /lib/Frontend/PCHWriter.cpp | |
parent | cdd209dd9eb22a33cc9017f6605375fd17c9e809 (diff) |
PCH read/write for selector reference pool.
Finishes off radar 6507158.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109256 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index b97aecbd8c..0b8c5b4258 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -630,6 +630,7 @@ void PCHWriter::WriteBlockInfoBlock() { RECORD(UNUSED_STATIC_FUNCS); RECORD(MACRO_DEFINITION_OFFSETS); RECORD(CHAINED_METADATA); + RECORD(REFERENCED_SELECTOR_POOL); // SourceManager Block. BLOCK(SOURCE_MANAGER_BLOCK); @@ -1737,6 +1738,26 @@ void PCHWriter::WriteMethodPool(Sema &SemaRef) { } } +/// \brief Write the selectors referenced in @selector expression into PCH file. +void PCHWriter::WriteReferencedSelectorsPool(Sema &SemaRef) { + using namespace llvm; + if (SemaRef.ReferencedSelectors.empty()) + return; + + RecordData Record; + + Record.push_back(SemaRef.ReferencedSelectors.size()); + for (DenseMap<Selector, SourceLocation>::iterator S = + SemaRef.ReferencedSelectors.begin(), + E = SemaRef.ReferencedSelectors.end(); S != E; ++S) { + Selector Sel = (*S).first; + SourceLocation Loc = (*S).second; + AddSelectorRef(Sel, Record); + AddSourceLocation(Loc, Record); + } + Stream.EmitRecord(pch::REFERENCED_SELECTOR_POOL, Record); +} + //===----------------------------------------------------------------------===// // Identifier Table Serialization //===----------------------------------------------------------------------===// @@ -2247,6 +2268,7 @@ void PCHWriter::WritePCHCore(Sema &SemaRef, MemorizeStatCalls *StatCalls, WritePreprocessor(PP); WriteMethodPool(SemaRef); + WriteReferencedSelectorsPool(SemaRef); WriteIdentifierTable(PP); WriteTypeDeclOffsets(); |