summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphael Isemann <teemperor@gmail.com>2018-01-22 15:27:25 +0000
committerRaphael Isemann <teemperor@gmail.com>2018-01-22 15:27:25 +0000
commitb0fd08cfbeba364534cbd27988b25034bc73b20b (patch)
treeef5ce2e10018a4f58aa63f76f15577cb0bef1405
parent7b1dc5fb9ff0ca22baac036b15c069f73523e892 (diff)
[modules] Correctly overload getModule in the MultiplexExternalSemaSource
Summary: The MultiplexExternalSemaSource doesn't correctly overload the `getModule` function, causing the multiplexer to not forward this call as intended. Reviewers: v.g.vassilev Reviewed By: v.g.vassilev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39416 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323122 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Sema/MultiplexExternalSemaSource.h6
-rw-r--r--lib/Sema/MultiplexExternalSemaSource.cpp7
2 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/Sema/MultiplexExternalSemaSource.h b/include/clang/Sema/MultiplexExternalSemaSource.h
index 1d681a0055..4de36afbcb 100644
--- a/include/clang/Sema/MultiplexExternalSemaSource.h
+++ b/include/clang/Sema/MultiplexExternalSemaSource.h
@@ -148,8 +148,10 @@ public:
/// \brief Print any statistics that have been gathered regarding
/// the external AST source.
void PrintStats() override;
-
-
+
+ /// \brief Retrieve the module that corresponds to the given module ID.
+ Module *getModule(unsigned ID) override;
+
/// \brief Perform layout on the given record.
///
/// This routine allows the external AST source to provide an specific
diff --git a/lib/Sema/MultiplexExternalSemaSource.cpp b/lib/Sema/MultiplexExternalSemaSource.cpp
index 77ace0cfa5..46238fb3e4 100644
--- a/lib/Sema/MultiplexExternalSemaSource.cpp
+++ b/lib/Sema/MultiplexExternalSemaSource.cpp
@@ -164,6 +164,13 @@ void MultiplexExternalSemaSource::PrintStats() {
Sources[i]->PrintStats();
}
+Module *MultiplexExternalSemaSource::getModule(unsigned ID) {
+ for (size_t i = 0; i < Sources.size(); ++i)
+ if (auto M = Sources[i]->getModule(ID))
+ return M;
+ return nullptr;
+}
+
bool MultiplexExternalSemaSource::layoutRecordType(const RecordDecl *Record,
uint64_t &Size,
uint64_t &Alignment,