Skip to content

Commit 5bef4c3

Browse files
committed
[Index] Skip indexing modules failing to build but write it down
1 parent c22eb45 commit 5bef4c3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Index/IndexRecord.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
516516

517517
// Reload resilient modules from swiftinterface to avoid indexing
518518
// internal details.
519+
bool skipIndexingModule = false;
519520
if (module->getResilienceStrategy() == ResilienceStrategy::Resilient) {
520521
module->getASTContext().setIgnoreAdjacentModules(true);
521522

@@ -526,7 +527,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
526527
module = reloadedModule;
527528
} else {
528529
// If we can't rebuild from the swiftinterface, don't index this module.
529-
return true;
530+
skipIndexingModule = true;
530531
}
531532
}
532533

@@ -537,7 +538,9 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
537538
// Pairs of (recordFile, groupName).
538539
std::vector<std::pair<std::string, std::string>> records;
539540

540-
if (!module->isStdlibModule()) {
541+
if (skipIndexingModule) {
542+
// Don't add anything to records.
543+
} else if (!module->isStdlibModule()) {
541544
std::string recordFile;
542545
bool failed = false;
543546
auto consumer = makeRecordingConsumer(filename.str(), indexStorePath.str(),

0 commit comments

Comments
 (0)