File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2061,11 +2061,15 @@ class AsyncCallEmission final : public CallEmission {
20612061 Size contextSize;
20622062 Address context;
20632063 llvm::Value *thickContext = nullptr ;
2064+ Optional<AsyncContextLayout> asyncContextLayout;
20642065
20652066 AsyncContextLayout getAsyncContextLayout () {
2066- return ::getAsyncContextLayout (IGF, getCallee ().getOrigFunctionType (),
2067- getCallee ().getSubstFunctionType (),
2068- getCallee ().getSubstitutions ());
2067+ if (!asyncContextLayout) {
2068+ asyncContextLayout.emplace (::getAsyncContextLayout (
2069+ IGF, getCallee ().getOrigFunctionType (),
2070+ getCallee ().getSubstFunctionType (), getCallee ().getSubstitutions ()));
2071+ }
2072+ return *asyncContextLayout;
20692073 }
20702074
20712075 void saveValue (ElementLayout layout, Explosion &explosion, bool isOutlined) {
You can’t perform that action at this time.
0 commit comments