Skip to content

Commit f6bfd41

Browse files
committed
[NFC] Use TypeInfo for indirect return storage.
Previously a raw CreateLoad was used, which happened to be fine. Here, a TI is used, explicitly clarifying that the indirect return is taken.
1 parent b90cab6 commit f6bfd41

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/IRGen/IRGenSIL.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,11 +1260,13 @@ class AsyncNativeCCEntryPointArgumentEmission final
12601260
"indirected through the context");
12611261
}
12621262
llvm::Value *getIndirectResult(unsigned index) override {
1263-
Address dataAddr = layout.emitCastTo(IGF, context);
12641263
auto fieldLayout = layout.getIndirectReturnLayout(index);
12651264
Address fieldAddr =
12661265
fieldLayout.project(IGF, dataAddr, /*offsets*/ llvm::None);
1267-
return IGF.Builder.CreateLoad(fieldAddr);
1266+
auto &ti = cast<LoadableTypeInfo>(fieldLayout.getType());
1267+
Explosion explosion;
1268+
ti.loadAsTake(IGF, fieldAddr, explosion);
1269+
return explosion.claimNext();
12681270
};
12691271
llvm::Value *getSelfWitnessTable() override {
12701272
llvm_unreachable("unimplemented");

0 commit comments

Comments
 (0)