Skip to content

Commit fae0628

Browse files
committed
Implement partial specialization which supports generic substitutions.
Use -sil-partial-specialization-with-generic-substitutions to enable the partial specialization even in cases of substitutions containing generic replacement types.
1 parent 7e657e5 commit fae0628

File tree

2 files changed

+717
-15
lines changed

2 files changed

+717
-15
lines changed

include/swift/SILOptimizer/Utils/Generics.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ class ReabstractionInfo {
197197
return SpecializedGenericEnv;
198198
}
199199

200+
GenericSignature *getSpecializedGenericSignature() const {
201+
return SpecializedGenericSig;
202+
}
203+
200204
SubstitutionList getCallerParamSubstitutions() const {
201205
return CallerParamSubs;
202206
}
@@ -236,6 +240,8 @@ class ReabstractionInfo {
236240
/// Returns true if a given apply can be specialized.
237241
static bool canBeSpecialized(ApplySite Apply, SILFunction *Callee,
238242
SubstitutionList ParamSubs);
243+
244+
void verify() const;
239245
};
240246

241247
/// Helper class for specializing a generic function given a list of

0 commit comments

Comments
 (0)