Merge pull request #62567 from gottesmm/pr-aff949c3a3e3aaf7839d4462bd96b8eb60c06f97

[move-only-object] Teach move only object verifier how to emit proper errors for closure/defer uses
This commit is contained in:
Michael Gottesman
2022-12-14 13:51:28 -08:00
committed by GitHub
8 changed files with 535 additions and 250 deletions

View File

@@ -952,3 +952,12 @@ SILGenBuilder::createMarkMustCheckInst(SILLocation loc, ManagedValue value,
loc, value.forward(getSILGenFunction()), kind);
return cloner.clone(mdi);
}
ManagedValue SILGenBuilder::emitCopyValueOperation(SILLocation loc,
ManagedValue value) {
auto cvi = SILBuilder::emitCopyValueOperation(loc, value.getValue());
// Trivial type.
if (cvi == value.getValue())
return value;
return SGF.emitManagedRValueWithCleanup(cvi);
}