[CoroutineAccessors] Old ABI may be used via flag.

Add a setting to IRGenOptions and key off of it to emit yield_once_2
coroutines using either (1) the same code-path as yield_once coroutines
or (2) a new, not-yet implemented code-path.

Add flags to set the value in both directions.  During bringup, by
default, use the existing caller-allocated ABI.
This commit is contained in:
Nate Chandler
2024-10-01 15:09:16 -07:00
parent 11b5d27594
commit 49a2831d3f
7 changed files with 109 additions and 22 deletions

View File

@@ -3473,6 +3473,8 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
Args.hasFlag(OPT_enable_fragile_resilient_protocol_witnesses,
OPT_disable_fragile_resilient_protocol_witnesses,
Opts.UseFragileResilientProtocolWitnesses);
Opts.EmitYieldOnce2AsYieldOnce =
!LangOpts.hasFeature(Feature::CoroutineAccessorsAllocateInCallee);
Opts.EnableHotColdSplit =
Args.hasFlag(OPT_enable_split_cold_code,
OPT_disable_split_cold_code,