Skip to content

Commit 2eb43a6

Browse files
authored
Merge pull request #78984 from swiftlang/blocklist-indexing-while-building-per-module
Indexing: add blocklist support for avoiding indexing specific module names
2 parents 18fa490 + ca17ac0 commit 2eb43a6

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
@@ -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

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