summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-04-29 19:04:05 +0000
committerManman Ren <manman.ren@gmail.com>2016-04-29 19:04:05 +0000
commita0f31a01f34dbde84b331cf49685c04cf02c8250 (patch)
tree5fd2008f8a310a2c91eef697bc1c068290455c28 /clang/lib/Serialization/ASTReader.cpp
parentb014ee467d61ad0cfbf59f721b29e27082ea878d (diff)
downloadbcm5719-llvm-a0f31a01f34dbde84b331cf49685c04cf02c8250.tar.gz
bcm5719-llvm-a0f31a01f34dbde84b331cf49685c04cf02c8250.zip
Method Pool in modules: we make sure that if a module contains an entry for
a selector, the entry should be complete, containing everything introduced by that module and all modules it imports. Before writing out the method pool of a module, we sync up the out of date selectors by pulling in methods for the selectors, from all modules it imports. In ReadMethodPool, after pulling in the method pool entry for module A, this lets us skip the modules that module A imports. rdar://problem/25900131 llvm-svn: 268091
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 910f5dcf779..aa672b3a7ec 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -3606,6 +3606,9 @@ ASTReader::ASTReadResult ASTReader::ReadAST(StringRef FileName,
Id != IdEnd; ++Id)
Id->second->setOutOfDate(true);
}
+ // Mark selectors as out of date.
+ for (auto Sel : SelectorGeneration)
+ SelectorOutOfDate[Sel.first] = true;
// Resolve any unresolved module exports.
for (unsigned I = 0, N = UnresolvedModuleRefs.size(); I != N; ++I) {
@@ -7139,6 +7142,7 @@ void ASTReader::ReadMethodPool(Selector Sel) {
unsigned &Generation = SelectorGeneration[Sel];
unsigned PriorGeneration = Generation;
Generation = getGeneration();
+ SelectorOutOfDate[Sel] = false;
// Search for methods defined with this selector.
++NumMethodPoolLookups;
@@ -7170,6 +7174,11 @@ void ASTReader::ReadMethodPool(Selector Sel) {
addMethodsToPool(S, Visitor.getFactoryMethods(), Pos->second.second);
}
+void ASTReader::updateOutOfDateSelector(Selector Sel) {
+ if (SelectorOutOfDate[Sel])
+ ReadMethodPool(Sel);
+}
+
void ASTReader::ReadKnownNamespaces(
SmallVectorImpl<NamespaceDecl *> &Namespaces) {
Namespaces.clear();
OpenPOWER on IntegriCloud