Skip to content

Commit 7ea1c69

Browse files
authored
Merge pull request #79064 from swiftlang/block-list-module-index
🍒 [6.1] Indexing: add blocklist support for avoiding indexing specific module names
2 parents ba9f703 + f06660a commit 7ea1c69

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)