Skip to content

Commit 0356c9f

Browse files
committed
[NFC] Simplify saving of self to async context.
1 parent 409f3d2 commit 0356c9f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,9 +2004,6 @@ class AsyncCallEmission final : public CallEmission {
20042004
IGF.getSILModule());
20052005

20062006
// Move all the arguments into the context.
2007-
if (selfValue) {
2008-
llArgs.add(selfValue);
2009-
}
20102007
auto layout = getAsyncContextLayout();
20112008
for (unsigned index = 0, count = layout.getIndirectReturnCount();
20122009
index < count; ++index) {
@@ -2024,8 +2021,10 @@ class AsyncCallEmission final : public CallEmission {
20242021
layout.getBindings().save(IGF, bindingsAddr, llArgs);
20252022
}
20262023
if (selfValue) {
2024+
Explosion selfExplosion;
2025+
selfExplosion.add(selfValue);
20272026
auto fieldLayout = layout.getLocalContextLayout();
2028-
saveValue(fieldLayout, llArgs, isOutlined);
2027+
saveValue(fieldLayout, selfExplosion, isOutlined);
20292028
}
20302029
}
20312030
void emitCallToUnmappedExplosion(llvm::CallInst *call, Explosion &out) override {

0 commit comments

Comments
 (0)