Skip to content

Commit 53072e8

Browse files
authored
Merge pull request swiftlang#72275 from hamishknight/unset
[Index] Scope the setting of `IgnoreAdjacentModules`
2 parents 559927d + 8a9be10 commit 53072e8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Index/IndexRecord.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -757,10 +757,10 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
757757
module->getResilienceStrategy() == ResilienceStrategy::Resilient &&
758758
!module->isBuiltFromInterface() &&
759759
!module->isStdlibModule()) {
760-
module->getASTContext().setIgnoreAdjacentModules(true);
760+
auto &ctx = module->getASTContext();
761+
llvm::SaveAndRestore<bool> S(ctx.IgnoreAdjacentModules, true);
761762

762763
ImportPath::Module::Builder builder(module->getName());
763-
ASTContext &ctx = module->getASTContext();
764764
auto reloadedModule = ctx.getModule(builder.get(),
765765
/*AllowMemoryCached=*/false);
766766

0 commit comments

Comments
 (0)