From: Richard Smith Date: Thu, 14 Apr 2016 00:50:18 +0000 (+0000) Subject: [modules] Store the location of the lexical update record in a decl update as X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=118bb87d406821cea6cd961286a114eac10262cc;p=clang [modules] Store the location of the lexical update record in a decl update as an offset from the current record rather than as an absolute bit number. This gives a minor .pcm file size reduction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266269 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp index 03d1b115d0..d81d73d4ba 100644 --- a/lib/Serialization/ASTReaderDecl.cpp +++ b/lib/Serialization/ASTReaderDecl.cpp @@ -3767,7 +3767,7 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile, ReadCXXRecordDefinition(RD, /*Update*/true); // Visible update is handled separately. - uint64_t LexicalOffset = Record[Idx++]; + uint64_t LexicalOffset = ReadLocalOffset(Record, Idx); if (!HadRealDefinition && LexicalOffset) { Reader.ReadLexicalDeclContextStorage(ModuleFile, ModuleFile.DeclsCursor, LexicalOffset, RD); diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index 2fec5c2349..5b5ecb177d 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -4661,8 +4661,7 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) { auto *RD = cast(D); UpdatedDeclContexts.insert(RD->getPrimaryContext()); Record.AddCXXDefinitionData(RD); - // FIXME: Use AddOffset here. - Record.push_back(WriteDeclContextLexicalBlock( + Record.AddOffset(WriteDeclContextLexicalBlock( *Context, const_cast(RD))); // This state is sometimes updated by template instantiation, when we