@@ -263,6 +263,9 @@ struct ASTContext::Implementation {
263
263
// / The module loader used to load Clang modules from DWARF.
264
264
ClangModuleLoader *TheDWARFModuleLoader = nullptr ;
265
265
266
+ // / The module loader used to load Swift textual interface.
267
+ ModuleLoader *TheModuleInterfaceLoader = nullptr ;
268
+
266
269
// / Map from Swift declarations to raw comments.
267
270
llvm::DenseMap<const Decl *, RawComment> RawComments;
268
271
@@ -1450,14 +1453,15 @@ void ASTContext::addSearchPath(StringRef searchPath, bool isFramework,
1450
1453
}
1451
1454
1452
1455
void ASTContext::addModuleLoader (std::unique_ptr<ModuleLoader> loader,
1453
- bool IsClang, bool IsDwarf) {
1456
+ bool IsClang, bool IsDwarf, bool IsInterface ) {
1454
1457
if (IsClang && !IsDwarf && !getImpl ().TheClangModuleLoader )
1455
1458
getImpl ().TheClangModuleLoader =
1456
1459
static_cast <ClangModuleLoader *>(loader.get ());
1457
1460
if (IsClang && IsDwarf && !getImpl ().TheDWARFModuleLoader )
1458
1461
getImpl ().TheDWARFModuleLoader =
1459
1462
static_cast <ClangModuleLoader *>(loader.get ());
1460
-
1463
+ if (IsInterface && !getImpl ().TheModuleInterfaceLoader )
1464
+ getImpl ().TheModuleInterfaceLoader = loader.get ();
1461
1465
getImpl ().ModuleLoaders .push_back (std::move (loader));
1462
1466
}
1463
1467
@@ -1532,6 +1536,10 @@ ClangModuleLoader *ASTContext::getDWARFModuleLoader() const {
1532
1536
return getImpl ().TheDWARFModuleLoader ;
1533
1537
}
1534
1538
1539
+ ModuleLoader *ASTContext::getModuleInterfaceLoader () const {
1540
+ return getImpl ().TheModuleInterfaceLoader ;
1541
+ }
1542
+
1535
1543
ModuleDecl *ASTContext::getLoadedModule (
1536
1544
ArrayRef<Located<Identifier>> ModulePath) const {
1537
1545
assert (!ModulePath.empty ());
0 commit comments