File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -3033,8 +3033,17 @@ void SILSpecializeAttr::print(llvm::raw_ostream &OS) const {
3033
3033
OS << " exported: " << exported << " , " ;
3034
3034
OS << " kind: " << kind << " , " ;
3035
3035
3036
- auto requirements = getSpecializedSignature ()->requirementsNotSatisfiedBy (
3037
- getFunction ()->getGenericEnvironment ()->getGenericSignature ());
3036
+ ArrayRef<Requirement> requirements;
3037
+ SmallVector<Requirement, 4 > requirementsScratch;
3038
+ if (auto specializedSig = getSpecializedSignature ()) {
3039
+ if (auto env = getFunction ()->getGenericEnvironment ()) {
3040
+ requirementsScratch = specializedSig->requirementsNotSatisfiedBy (
3041
+ env->getGenericSignature ());
3042
+ requirements = requirementsScratch;
3043
+ } else {
3044
+ requirements = specializedSig->getRequirements ();
3045
+ }
3046
+ }
3038
3047
if (!requirements.empty ()) {
3039
3048
OS << " where " ;
3040
3049
SILFunction *F = getFunction ();
You can’t perform that action at this time.
0 commit comments