Skip to content

Commit f06660a

Browse files
committed
Indexing: add blocklist support for avoiding indexing specific module names
Indexing while building sometimes triggers module deserialization issues, exemplified by a recent issue of rdar://141357099. This change introduces the blocklist support to avoid indexing specific module names so we could rely on external data source for unblocking builds, instead of modifying the compiler source. Resolves: rdar://143770366
1 parent e5f514d commit f06660a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/swift/Basic/BlockListAction.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ BLOCKLIST_ACTION(ShouldUseTextualModule)
2424
BLOCKLIST_ACTION(DowngradeInterfaceVerificationFailure)
2525
BLOCKLIST_ACTION(ShouldUseLayoutStringValueWitnesses)
2626
BLOCKLIST_ACTION(SkipEmittingFineModuleTrace)
27+
BLOCKLIST_ACTION(SkipIndexingModule)
2728

2829
#undef BLOCKLIST_ACTION

lib/Index/Index.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2155,6 +2155,12 @@ void index::indexSourceFile(SourceFile *SF, IndexDataConsumer &consumer) {
21552155

21562156
void index::indexModule(ModuleDecl *module, IndexDataConsumer &consumer) {
21572157
assert(module);
2158+
auto mName = module->getRealName().str();
2159+
if (module->getASTContext().blockListConfig.hasBlockListAction(mName,
2160+
BlockListKeyKind::ModuleName,
2161+
BlockListAction::SkipIndexingModule)) {
2162+
return;
2163+
}
21582164
IndexSwiftASTWalker walker(consumer, module->getASTContext());
21592165
walker.visitModule(*module);
21602166
consumer.finish();

0 commit comments

Comments
 (0)