summaryrefslogtreecommitdiffstats
path: root/clang/include
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/include
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/include')
-rw-r--r--clang/include/clang/Sema/ExternalSemaSource.h4
-rw-r--r--clang/include/clang/Sema/MultiplexExternalSemaSource.h4
-rw-r--r--clang/include/clang/Sema/Sema.h1
-rw-r--r--clang/include/clang/Serialization/ASTReader.h8
4 files changed, 17 insertions, 0 deletions
diff --git a/clang/include/clang/Sema/ExternalSemaSource.h b/clang/include/clang/Sema/ExternalSemaSource.h
index 2fdc42b1ac1..c2b13046d70 100644
--- a/clang/include/clang/Sema/ExternalSemaSource.h
+++ b/clang/include/clang/Sema/ExternalSemaSource.h
@@ -70,6 +70,10 @@ public:
/// selector.
virtual void ReadMethodPool(Selector Sel);
+ /// Load the contents of the global method pool for a given
+ /// selector if necessary.
+ virtual void updateOutOfDateSelector(Selector Sel);
+
/// \brief Load the set of namespaces that are known to the external source,
/// which will be used during typo correction.
virtual void ReadKnownNamespaces(
diff --git a/clang/include/clang/Sema/MultiplexExternalSemaSource.h b/clang/include/clang/Sema/MultiplexExternalSemaSource.h
index 5f43f4051aa..9bf8cd3d925 100644
--- a/clang/include/clang/Sema/MultiplexExternalSemaSource.h
+++ b/clang/include/clang/Sema/MultiplexExternalSemaSource.h
@@ -203,6 +203,10 @@ public:
/// selector.
void ReadMethodPool(Selector Sel) override;
+ /// Load the contents of the global method pool for a given
+ /// selector if necessary.
+ void updateOutOfDateSelector(Selector Sel) override;
+
/// \brief Load the set of namespaces that are known to the external source,
/// which will be used during typo correction.
void
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index a0dcd701df6..7731569fbce 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -1017,6 +1017,7 @@ public:
llvm::SmallSet<SpecialMemberDecl, 4> SpecialMembersBeingDeclared;
void ReadMethodPool(Selector Sel);
+ void updateOutOfDateSelector(Selector Sel);
/// Private Helper predicate to check for 'self'.
bool isSelfExpr(Expr *RExpr);
diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h
index a80989d8861..6e1cb0a916c 100644
--- a/clang/include/clang/Serialization/ASTReader.h
+++ b/clang/include/clang/Serialization/ASTReader.h
@@ -653,6 +653,10 @@ private:
/// global method pool for this selector.
llvm::DenseMap<Selector, unsigned> SelectorGeneration;
+ /// Whether a selector is out of date. We mark a selector as out of date
+ /// if we load another module after the method pool entry was pulled in.
+ llvm::DenseMap<Selector, bool> SelectorOutOfDate;
+
struct PendingMacroInfo {
ModuleFile *M;
uint64_t MacroDirectivesOffset;
@@ -1781,6 +1785,10 @@ public:
/// selector.
void ReadMethodPool(Selector Sel) override;
+ /// Load the contents of the global method pool for a given
+ /// selector if necessary.
+ void updateOutOfDateSelector(Selector Sel) override;
+
/// \brief Load the set of namespaces that are known to the external source,
/// which will be used during typo correction.
void ReadKnownNamespaces(
OpenPOWER on IntegriCloud