@@ -761,6 +761,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
761
761
SourceFile *initialFile) {
762
762
StringRef filename = module ->getModuleSourceFilename ();
763
763
std::string moduleName = module ->getNameStr ().str ();
764
+ auto &ctx = module ->getASTContext ();
764
765
765
766
// If this is a cross-import overlay, make sure we use the name of the
766
767
// underlying module instead.
@@ -786,7 +787,6 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
786
787
module ->getResilienceStrategy () == ResilienceStrategy::Resilient &&
787
788
!module ->isBuiltFromInterface () &&
788
789
!module ->isStdlibModule ()) {
789
- auto &ctx = module ->getASTContext ();
790
790
llvm::SaveAndRestore<bool > S (ctx.IgnoreAdjacentModules , true );
791
791
792
792
ImportPath::Module::Builder builder (module ->getName ());
@@ -801,6 +801,22 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
801
801
}
802
802
}
803
803
804
+ // If this module is blocklisted from us using its textual interface,
805
+ // then under Implicitly-Built modules it will not get indexed, since
806
+ // indexing will not be able to spawn swiftinterface compilation.
807
+ // With explicitly-built modules, none of the dependency modules get built
808
+ // from interface during indexing, which means we directly index input
809
+ // binary modules.
810
+ //
811
+ // For now, for functional parity with Implicit Module Builds, disable indexing
812
+ // of modules during Explicit Module Builds which would not get indexed during
813
+ // Implicit Module Builds.
814
+ if (explicitModuleBuild &&
815
+ ctx.blockListConfig .hasBlockListAction (moduleName,
816
+ BlockListKeyKind::ModuleName,
817
+ BlockListAction::ShouldUseBinaryModule))
818
+ skipIndexingModule = true ;
819
+
804
820
if (module ->getASTContext ().LangOpts .EnableIndexingSystemModuleRemarks ) {
805
821
diags.diagnose (SourceLoc (),
806
822
diag::remark_indexing_system_module,
0 commit comments