Skip to content

Commit

Permalink
[NFC] Use TypeInfo for indirect return storage.
Browse files Browse the repository at this point in the history
Previously a raw CreateLoad was used, which happened to be fine.  Here,
a TI is used, explicitly clarifying that the indirect return is taken.
  • Loading branch information
nate-chandler committed Oct 6, 2020
1 parent b90cab6 commit f6bfd41
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/IRGen/IRGenSIL.cpp
Expand Up @@ -1260,11 +1260,13 @@ class AsyncNativeCCEntryPointArgumentEmission final
"indirected through the context");
}
llvm::Value *getIndirectResult(unsigned index) override {
Address dataAddr = layout.emitCastTo(IGF, context);
auto fieldLayout = layout.getIndirectReturnLayout(index);
Address fieldAddr =
fieldLayout.project(IGF, dataAddr, /*offsets*/ llvm::None);
return IGF.Builder.CreateLoad(fieldAddr);
auto &ti = cast<LoadableTypeInfo>(fieldLayout.getType());
Explosion explosion;
ti.loadAsTake(IGF, fieldAddr, explosion);
return explosion.claimNext();
};
llvm::Value *getSelfWitnessTable() override {
llvm_unreachable("unimplemented");
Expand Down

0 comments on commit f6bfd41

Please sign in to comment.