diff options
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index d6660e8b9b4..5596bb4e748 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -2644,6 +2644,7 @@ void ASTReader::loadDeclUpdateRecords(serialization::DeclID ID, Decl *D) { DeclUpdateOffsetsMap::iterator UpdI = DeclUpdateOffsets.find(ID); if (UpdI != DeclUpdateOffsets.end()) { FileOffsetsTy &UpdateOffsets = UpdI->second; + bool WasInteresting = isConsumerInterestedIn(D, false); for (FileOffsetsTy::iterator I = UpdateOffsets.begin(), E = UpdateOffsets.end(); I != E; ++I) { ModuleFile *F = I->first; @@ -2656,10 +2657,18 @@ void ASTReader::loadDeclUpdateRecords(serialization::DeclID ID, Decl *D) { unsigned RecCode = Cursor.readRecord(Code, Record); (void)RecCode; assert(RecCode == DECL_UPDATES && "Expected DECL_UPDATES record!"); - + unsigned Idx = 0; ASTDeclReader Reader(*this, *F, ID, 0, Record, Idx); Reader.UpdateDecl(D, *F, Record); + + // We might have made this declaration interesting. If so, remember that + // we need to hand it off to the consumer. + if (!WasInteresting && + isConsumerInterestedIn(D, Reader.hasPendingBody())) { + InterestingDecls.push_back(D); + WasInteresting = true; + } } } } @@ -2958,6 +2967,7 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile, Reader.ReadCXXCtorInitializers(ModuleFile, Record, Idx); // Store the offset of the body so we can lazily load it later. Reader.PendingBodies[FD] = GetCurrentCursorOffset(); + HasPendingBody = true; assert(Idx == Record.size() && "lazy body must be last"); break; } |