]> granicus.if.org Git - clang/commitdiff
[modules] Store the location of the lexical update record in a decl update as
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 14 Apr 2016 00:50:18 +0000 (00:50 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 14 Apr 2016 00:50:18 +0000 (00:50 +0000)
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

lib/Serialization/ASTReaderDecl.cpp
lib/Serialization/ASTWriter.cpp

index 03d1b115d023338960ac4ab123ba52209a7cb101..d81d73d4ba7b2a28ba906062592dd62ddada52ee 100644 (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);
index 2fec5c234930e9ed3437fa9c73b5cb35727908e1..5b5ecb177de4ad276293cf9c1e04aa8ab0cffa56 100644 (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