diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-03 23:28:44 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-03 23:28:44 +0000 |
commit | b18b1fd33f958264630fbae2602c81275bae8c9a (patch) | |
tree | ca843a1a83c6ddae594a6c26eab6d4a0458000bd /lib/Serialization/ASTWriter.cpp | |
parent | 033a07e5fca459ed184369cfee7c90d82367a93a (diff) |
Introduce local -> global selector ID mapping into the AST
reader. Tested with the usual "gaps" method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136839 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index ee72f63c16..b5df82a2cd 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -2219,6 +2219,7 @@ void ASTWriter::WriteSelectors(Sema &SemaRef) { Abbrev = new BitCodeAbbrev(); Abbrev->Add(BitCodeAbbrevOp(SELECTOR_OFFSETS)); Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // size + Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Fixed, 32)); // first ID Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); unsigned SelectorOffsetAbbrev = Stream.EmitAbbrev(Abbrev); @@ -2226,6 +2227,7 @@ void ASTWriter::WriteSelectors(Sema &SemaRef) { Record.clear(); Record.push_back(SELECTOR_OFFSETS); Record.push_back(SelectorOffsets.size()); + Record.push_back(FirstSelectorID - NUM_PREDEF_SELECTOR_IDS); Stream.EmitRecordWithBlob(SelectorOffsetAbbrev, Record, data(SelectorOffsets)); } @@ -2745,8 +2747,8 @@ ASTWriter::ASTWriter(llvm::BitstreamWriter &Stream) FirstDeclID(NUM_PREDEF_DECL_IDS), NextDeclID(FirstDeclID), FirstTypeID(NUM_PREDEF_TYPE_IDS), NextTypeID(FirstTypeID), FirstIdentID(NUM_PREDEF_IDENT_IDS), NextIdentID(FirstIdentID), - FirstSelectorID(1), - NextSelectorID(FirstSelectorID), FirstMacroID(1), NextMacroID(FirstMacroID), + FirstSelectorID(NUM_PREDEF_SELECTOR_IDS), NextSelectorID(FirstSelectorID), + FirstMacroID(1), NextMacroID(FirstMacroID), CollectedStmts(&StmtsToEmit), NumStatements(0), NumMacros(0), NumLexicalDeclContexts(0), NumVisibleDeclContexts(0), |