[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.

llvm-svn: 266269
This commit is contained in:
Richard Smith 2016-04-14 00:50:18 +00:00
parent f11e099052
commit 72e50fe4ac
2 changed files with 2 additions and 3 deletions

View File

@ -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);

View File

@ -4661,8 +4661,7 @@ void ASTWriter::WriteDeclUpdatesBlocks(RecordDataImpl &OffsetsRecord) {
auto *RD = cast<CXXRecordDecl>(D);
UpdatedDeclContexts.insert(RD->getPrimaryContext());
Record.AddCXXDefinitionData(RD);
// FIXME: Use AddOffset here.
Record.push_back(WriteDeclContextLexicalBlock(
Record.AddOffset(WriteDeclContextLexicalBlock(
*Context, const_cast<CXXRecordDecl *>(RD)));
// This state is sometimes updated by template instantiation, when we