[Parse] [Sema] Ensure lazy immediate mode only enabled when requested

This commit is contained in:
Zak Kent
2023-08-10 15:07:59 -07:00
parent 5e75c76386
commit d1c5b4a7ad
2 changed files with 5 additions and 2 deletions

View File

@@ -1576,7 +1576,9 @@ CompilerInstance::getSourceFileParsingOptions(bool forPrimary) const {
frontendOpts.ReuseFrontendForMultipleCompilations) {
opts |= ParsingFlags::EnableInterfaceHash;
}
if (action == ActionType::Immediate) {
const auto &LangOpts = Invocation.getLangOptions();
if (action == ActionType::Immediate &&
LangOpts.hasFeature(Feature::LazyImmediate)) {
opts -= ParsingFlags::DisableDelayedBodies;
opts -= ParsingFlags::ValidateNewParserDiagnostics;
}

View File

@@ -306,7 +306,8 @@ TypeCheckSourceFileRequest::evaluate(Evaluator &eval, SourceFile *SF) const {
}
}
}
if (!Ctx.TypeCheckerOpts.DeferToRuntime) {
if (!Ctx.TypeCheckerOpts.DeferToRuntime ||
!Ctx.LangOpts.hasFeature(Feature::LazyImmediate)) {
typeCheckDelayedFunctions(*SF);
}
}