summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-10-28 22:25:37 +0000
committerBen Langmuir <blangmuir@apple.com>2015-10-28 22:25:37 +0000
commitb9ad4e60638131f4d68c18f128bf44ccec2cd77c (patch)
treedf6f584bfb6f07b12dd63e557e4e9efaea7d8895 /clang/lib
parenta309efef399d342a364d051581b5f3738deba370 (diff)
downloadbcm5719-llvm-b9ad4e60638131f4d68c18f128bf44ccec2cd77c.tar.gz
bcm5719-llvm-b9ad4e60638131f4d68c18f128bf44ccec2cd77c.zip
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
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp6
1 files changed, 4 insertions, 2 deletions
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();
}
OpenPOWER on IntegriCloud