[frontend] Make -chain-include work when used with modules.
llvm-svn: 180633
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 6031ad2..ece51a3 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -294,6 +294,8 @@
source.reset(ChainedIncludesSource::create(CI));
if (!source)
goto failure;
+ CI.setModuleManager(static_cast<ASTReader*>(
+ &static_cast<ChainedIncludesSource*>(source.get())->getFinalReader()));
CI.getASTContext().setExternalSource(source);
} else if (!CI.getPreprocessorOpts().ImplicitPCHInclude.empty()) {