Skip to content

Commit d1c5b4a

Browse files
author
Zak Kent
committed
[Parse] [Sema] Ensure lazy immediate mode only enabled when requested
1 parent 5e75c76 commit d1c5b4a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/Frontend/Frontend.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,9 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
15761576
frontendOpts.ReuseFrontendForMultipleCompilations) {
15771577
opts |= ParsingFlags::EnableInterfaceHash;
15781578
}
1579-
if (action == ActionType::Immediate) {
1579+
const auto &LangOpts = Invocation.getLangOptions();
1580+
if (action == ActionType::Immediate &&
1581+
LangOpts.hasFeature(Feature::LazyImmediate)) {
15801582
opts -= ParsingFlags::DisableDelayedBodies;
15811583
opts -= ParsingFlags::ValidateNewParserDiagnostics;
15821584
}

lib/Sema/TypeChecker.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ TypeCheckSourceFileRequest::evaluate(Evaluator &eval, SourceFile *SF) const {
306306
}
307307
}
308308
}
309-
if (!Ctx.TypeCheckerOpts.DeferToRuntime) {
309+
if (!Ctx.TypeCheckerOpts.DeferToRuntime ||
310+
!Ctx.LangOpts.hasFeature(Feature::LazyImmediate)) {
310311
typeCheckDelayedFunctions(*SF);
311312
}
312313
}

0 commit comments

Comments
 (0)