[ClosureLifetimeFixup] Cleanups get CleanupLocs.

This commit is contained in:
Nate Chandler
2022-12-12 12:26:17 -08:00
parent bf84d8dfe0
commit 9fbbab8045
2 changed files with 45 additions and 2 deletions

View File

@@ -1462,7 +1462,7 @@ void swift::insertDestroyOfCapturedArguments(
ApplySite site(pai);
SILFunctionConventions calleeConv(site.getSubstCalleeType(),
pai->getModule());
auto loc = RegularLocation::getAutoGeneratedLocation();
auto loc = CleanupLocation(RegularLocation::getAutoGeneratedLocation());
for (auto &arg : pai->getArgumentOperands()) {
if (!shouldInsertDestroy(arg.get()))
continue;
@@ -1480,7 +1480,7 @@ void swift::insertDeallocOfCapturedArguments(
ApplySite site(pai);
SILFunctionConventions calleeConv(site.getSubstCalleeType(),
pai->getModule());
auto loc = RegularLocation::getAutoGeneratedLocation();
auto loc = CleanupLocation(RegularLocation::getAutoGeneratedLocation());
for (auto &arg : pai->getArgumentOperands()) {
unsigned calleeArgumentIndex = site.getCalleeArgIndex(arg);
assert(calleeArgumentIndex >= calleeConv.getSILArgIndexOfFirstParam());