Skip to content

Commit ca17ac0

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 e17df88 commit ca17ac0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/swift/Basic/BlockListAction.def

+1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ BLOCKLIST_ACTION(DowngradeInterfaceVerificationFailure)
2525
BLOCKLIST_ACTION(ShouldUseLayoutStringValueWitnesses)
2626
BLOCKLIST_ACTION(ShouldDisableOwnershipVerification)
2727
BLOCKLIST_ACTION(SkipEmittingFineModuleTrace)
28+
BLOCKLIST_ACTION(SkipIndexingModule)
2829

2930
#undef BLOCKLIST_ACTION

lib/Index/Index.cpp

+6
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().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)