File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ class SILFunction
236236 // / The lowered type of the function.
237237 CanSILFunctionType LoweredType;
238238
239+ CanSILFunctionType LoweredTypeInContext;
240+
239241 // / The context archetypes of the function.
240242 GenericEnvironment *GenericEnv = nullptr ;
241243
Original file line number Diff line number Diff line change @@ -5292,7 +5292,12 @@ TypeExpansionContext::TypeExpansionContext(const SILFunction &f)
52925292 isContextWholeModule(f.getModule().isWholeModule()) {}
52935293
52945294CanSILFunctionType SILFunction::getLoweredFunctionTypeInContext () const {
5295- return getLoweredFunctionTypeInContext (getTypeExpansionContext ());
5295+ if (!LoweredTypeInContext) {
5296+ const_cast <SILFunction *>(this )->LoweredTypeInContext
5297+ = getLoweredFunctionTypeInContext (
5298+ getTypeExpansionContext ());
5299+ }
5300+ return LoweredTypeInContext;
52965301}
52975302
52985303CanSILFunctionType SILFunction::getLoweredFunctionTypeInContext (
You can’t perform that action at this time.
0 commit comments