IRGen and basic optimizer support for coroutines.

This commit is contained in:
John McCall
2018-01-07 01:13:42 -05:00
parent b80808bbc1
commit 3c54c0edfc
39 changed files with 1886 additions and 153 deletions

View File

@@ -2015,6 +2015,13 @@ static ApplySite replaceWithSpecializedCallee(ApplySite AI,
A->replaceAllUsesWith(NewAI);
return NewAI;
}
if (auto *A = dyn_cast<BeginApplyInst>(AI)) {
assert(!StoreResultTo);
auto *NewAI = Builder.createBeginApply(Loc, Callee, Subs, Arguments,
A->isNonThrowing());
A->replaceAllUsesPairwiseWith(NewAI);
return NewAI;
}
if (auto *PAI = dyn_cast<PartialApplyInst>(AI)) {
auto *NewPAI = Builder.createPartialApply(
Loc, Callee, Subs, Arguments,