Skip to content

Commit 32c359f

Browse files
committed
[Index] Skip indexing modules failing to build but write it down
1 parent 2e93ebc commit 32c359f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/Index/IndexRecord.cpp

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

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

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

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

539-
if (!module->isStdlibModule()) {
540+
if (skipIndexingModule) {
541+
// Don't add anything to records but keep going so we still mark the module
542+
// as indexed to avoid rebuilds of broken swiftinterfaces.
543+
} else if (!module->isStdlibModule()) {
540544
std::string recordFile;
541545
bool failed = false;
542546
auto consumer = makeRecordingConsumer(filename.str(), indexStorePath.str(),

0 commit comments

Comments
 (0)