[Immediate] Add frontend option for lazy compilation

This commit is contained in:
Zak Kent
2023-08-10 12:59:42 -07:00
parent 56ebd612b6
commit 289b812a14
4 changed files with 18 additions and 4 deletions

View File

@@ -1365,7 +1365,17 @@ static bool performAction(CompilerInstance &Instance,
return Instance.getASTContext().hadError();
});
case FrontendOptions::ActionType::Immediate: {
return RunImmediatelyFromAST(Instance) != -1;
const auto &Ctx = Instance.getASTContext();
if (Ctx.LangOpts.hasFeature(Feature::LazyImmediate)) {
ReturnValue = RunImmediatelyFromAST(Instance);
return Ctx.hadError();
}
return withSemanticAnalysis(
Instance, observer, [&](CompilerInstance &Instance) {
assert(FrontendOptions::doesActionGenerateSIL(opts.RequestedAction) &&
"All actions not requiring SILGen must have been handled!");
return performCompileStepsPostSema(Instance, ReturnValue, observer);
});
}
case FrontendOptions::ActionType::EmitSILGen:
case FrontendOptions::ActionType::EmitSIBGen: