@@ -761,6 +761,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
761761 SourceFile *initialFile) {
762762 StringRef filename = module ->getModuleSourceFilename ();
763763 std::string moduleName = module ->getNameStr ().str ();
764+ auto &ctx = module ->getASTContext ();
764765
765766 // If this is a cross-import overlay, make sure we use the name of the
766767 // underlying module instead.
@@ -786,7 +787,6 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
786787 module ->getResilienceStrategy () == ResilienceStrategy::Resilient &&
787788 !module ->isBuiltFromInterface () &&
788789 !module ->isStdlibModule ()) {
789- auto &ctx = module ->getASTContext ();
790790 llvm::SaveAndRestore<bool > S (ctx.IgnoreAdjacentModules , true );
791791
792792 ImportPath::Module::Builder builder (module ->getName ());
@@ -801,6 +801,22 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
801801 }
802802 }
803803
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+
804820 if (module ->getASTContext ().LangOpts .EnableIndexingSystemModuleRemarks ) {
805821 diags.diagnose (SourceLoc (),
806822 diag::remark_indexing_system_module,
0 commit comments