summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 32c9c4787c4..073ed674741 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -5784,13 +5784,8 @@ void ASTWriter::AddedObjCCategoryToInterface(const ObjCCategoryDecl *CatD,
void ASTWriter::DeclarationMarkedUsed(const Decl *D) {
assert(!WritingAST && "Already writing the AST!");
-
- // If there is *any* declaration of the entity that's not from an AST file,
- // we can skip writing the update record. We make sure that isUsed() triggers
- // completion of the redeclaration chain of the entity.
- for (auto Prev = D->getMostRecentDecl(); Prev; Prev = Prev->getPreviousDecl())
- if (IsLocalDecl(Prev))
- return;
+ if (!D->isFromASTFile())
+ return;
DeclUpdates[D].push_back(DeclUpdate(UPD_DECL_MARKED_USED));
}
OpenPOWER on IntegriCloud