From b9ad4e60638131f4d68c18f128bf44ccec2cd77c Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Wed, 28 Oct 2015 22:25:37 +0000 Subject: Fix missing builtin identifier infos with PCH+modules Use the *current* state of "is-moduleness" rather than the state at serialization time so that if we read a builtin identifier from a module that wasn't "interesting" to that module, we will still write it out to a PCH that imports that module. Otherwise, we would get mysterious "unknown builtin" errors when using PCH+modules. rdar://problem/23287656 llvm-svn: 251565 --- clang/lib/Serialization/ASTReader.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'clang/lib/Serialization/ASTReader.cpp') diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 4838a43e033..c54f659f09f 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -780,7 +780,8 @@ IdentifierInfo *ASTIdentifierLookupTrait::ReadData(const internal_key_type& k, } if (!II->isFromAST()) { II->setIsFromAST(); - if (isInterestingIdentifier(Reader, *II, F.isModule())) + bool IsModule = Reader.PP.getCurrentModule() != nullptr; + if (isInterestingIdentifier(Reader, *II, IsModule)) II->setChangedSinceDeserialization(); } Reader.markIdentifierUpToDate(II); @@ -3511,7 +3512,8 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, // whether we need to serialize it. if (!II.isFromAST()) { II.setIsFromAST(); - if (isInterestingIdentifier(*this, II, F.isModule())) + bool IsModule = PP.getCurrentModule() != nullptr; + if (isInterestingIdentifier(*this, II, IsModule)) II.setChangedSinceDeserialization(); } -- cgit v1.2.3