File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1073,6 +1073,12 @@ class TypeConverter {
10731073 GenericSignatureWithCapturedEnvironments
10741074 getGenericSignatureWithCapturedEnvironments (SILDeclRef constant);
10751075
1076+ // / Get the substitution map for calling a constant.
1077+ SubstitutionMap
1078+ getSubstitutionMapWithCapturedEnvironments (SILDeclRef constant,
1079+ const CaptureInfo &captureInfo,
1080+ SubstitutionMap subs);
1081+
10761082 // / Get the generic environment for a constant.
10771083 GenericEnvironment *getConstantGenericEnvironment (SILDeclRef constant);
10781084
Original file line number Diff line number Diff line change @@ -4110,6 +4110,21 @@ TypeConverter::getGenericSignatureWithCapturedEnvironments(SILDeclRef c) {
41104110 llvm_unreachable (" Unhandled SILDeclRefKind in switch." );
41114111}
41124112
4113+ SubstitutionMap
4114+ TypeConverter::getSubstitutionMapWithCapturedEnvironments (
4115+ SILDeclRef constant, const CaptureInfo &captureInfo,
4116+ SubstitutionMap subs) {
4117+ auto sig = getGenericSignatureWithCapturedEnvironments (constant);
4118+ if (!sig.genericSig ) {
4119+ assert (!sig.baseGenericSig );
4120+ assert (sig.capturedEnvs .empty ());
4121+ return SubstitutionMap ();
4122+ }
4123+
4124+ return buildSubstitutionMapWithCapturedEnvironments (
4125+ subs, sig.genericSig , sig.capturedEnvs );
4126+ }
4127+
41134128GenericEnvironment *
41144129TypeConverter::getConstantGenericEnvironment (SILDeclRef c) {
41154130 return getGenericSignatureWithCapturedEnvironments (c)
You can’t perform that action at this time.
0 commit comments