diff options
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 184e7efe84f..b5384bbc39e 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -3489,6 +3489,7 @@ void ASTReader::loadDeclUpdateRecords(serialization::DeclID ID, Decl *D) { // The declaration may have been modified by files later in the chain. // If this is the case, read the record containing the updates from each file // and pass it to ASTDeclReader to make the modifications. + ProcessingUpdatesRAIIObj ProcessingUpdates(*this); DeclUpdateOffsetsMap::iterator UpdI = DeclUpdateOffsets.find(ID); if (UpdI != DeclUpdateOffsets.end()) { auto UpdateOffsets = std::move(UpdI->second); @@ -3907,11 +3908,8 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile, } case UPD_DECL_MARKED_USED: { - // FIXME: This doesn't send the right notifications if there are - // ASTMutationListeners other than an ASTWriter. - // Maintain AST consistency: any later redeclarations are used too. - D->setIsUsed(); + D->markUsed(Reader.Context); break; } @@ -3935,11 +3933,8 @@ void ASTDeclReader::UpdateDecl(Decl *D, ModuleFile &ModuleFile, Exported = TD->getDefinition(); Module *Owner = SubmoduleID ? Reader.getSubmodule(SubmoduleID) : nullptr; if (Reader.getContext().getLangOpts().ModulesLocalVisibility) { - // FIXME: This doesn't send the right notifications if there are - // ASTMutationListeners other than an ASTWriter. - Reader.getContext().mergeDefinitionIntoModule( - cast<NamedDecl>(Exported), Owner, - /*NotifyListeners*/ false); + Reader.getContext().mergeDefinitionIntoModule(cast<NamedDecl>(Exported), + Owner); Reader.PendingMergedDefinitionsToDeduplicate.insert( cast<NamedDecl>(Exported)); } else if (Owner && Owner->NameVisibility != Module::AllVisible) { |