@@ -3776,8 +3776,7 @@ class SILParameterInfo {
3776
3776
// / Return the type of a call argument matching this parameter.
3777
3777
// /
3778
3778
// / \c t must refer back to the function type this is a parameter for.
3779
- CanType getArgumentType (SILModule &M,
3780
- const SILFunctionType *t) const ;
3779
+ CanType getArgumentType (SILModule &M, const SILFunctionType *t, TypeExpansionContext context) const ;
3781
3780
ParameterConvention getConvention () const {
3782
3781
return TypeAndConvention.getInt ();
3783
3782
}
@@ -3832,8 +3831,9 @@ class SILParameterInfo {
3832
3831
// / storage. Therefore they will be passed using an indirect formal
3833
3832
// / convention, and this method will return an address type. However, in
3834
3833
// / canonical SIL the opaque arguments might not have an address type.
3835
- SILType getSILStorageType (SILModule &M,
3836
- const SILFunctionType *t) const ; // in SILFunctionConventions.h
3834
+ SILType getSILStorageType (
3835
+ SILModule &M, const SILFunctionType *t,
3836
+ TypeExpansionContext context) const ; // in SILFunctionConventions.h
3837
3837
SILType getSILStorageInterfaceType () const ;
3838
3838
3839
3839
// / Return a version of this parameter info with the type replaced.
@@ -3865,9 +3865,9 @@ class SILParameterInfo {
3865
3865
// / type, apply any substitutions from the function type to it to
3866
3866
// / get a substituted version of it, as you would get from
3867
3867
// / SILFunctionType::getUnsubstitutedType.
3868
- SILParameterInfo getUnsubstituted (SILModule &M,
3869
- const SILFunctionType *fnType ) const {
3870
- return getWithInterfaceType (getArgumentType (M, fnType));
3868
+ SILParameterInfo getUnsubstituted (SILModule &M, const SILFunctionType *fnType,
3869
+ TypeExpansionContext context ) const {
3870
+ return getWithInterfaceType (getArgumentType (M, fnType, context ));
3871
3871
}
3872
3872
3873
3873
void profile (llvm::FoldingSetNodeID &id) {
@@ -3952,9 +3952,9 @@ class SILResultInfo {
3952
3952
// / The type of a return value corresponding to this result.
3953
3953
// /
3954
3954
// / \c t must refer back to the function type this is a parameter for.
3955
- CanType getReturnValueType (SILModule &M,
3956
- const SILFunctionType *t ) const ;
3957
-
3955
+ CanType getReturnValueType (SILModule &M, const SILFunctionType *t,
3956
+ TypeExpansionContext context ) const ;
3957
+
3958
3958
ResultConvention getConvention () const {
3959
3959
return TypeAndConvention.getInt ();
3960
3960
}
@@ -3964,8 +3964,9 @@ class SILResultInfo {
3964
3964
// / storage. Therefore they will be returned using an indirect formal
3965
3965
// / convention, and this method will return an address type. However, in
3966
3966
// / canonical SIL the opaque results might not have an address type.
3967
- SILType getSILStorageType (SILModule &M,
3968
- const SILFunctionType *t) const ; // in SILFunctionConventions.h
3967
+ SILType getSILStorageType (
3968
+ SILModule &M, const SILFunctionType *t,
3969
+ TypeExpansionContext context) const ; // in SILFunctionConventions.h
3969
3970
SILType getSILStorageInterfaceType () const ;
3970
3971
// / Return a version of this result info with the type replaced.
3971
3972
SILResultInfo getWithInterfaceType (CanType type) const {
@@ -4006,9 +4007,9 @@ class SILResultInfo {
4006
4007
// / type, apply any substitutions from the function type to it to
4007
4008
// / get a substituted version of it, as you would get from
4008
4009
// / SILFunctionType::getUnsubstitutedType.
4009
- SILResultInfo getUnsubstituted (SILModule &M,
4010
- const SILFunctionType *fnType ) const {
4011
- return getWithInterfaceType (getReturnValueType (M, fnType));
4010
+ SILResultInfo getUnsubstituted (SILModule &M, const SILFunctionType *fnType,
4011
+ TypeExpansionContext context ) const {
4012
+ return getWithInterfaceType (getReturnValueType (M, fnType, context ));
4012
4013
}
4013
4014
4014
4015
void profile (llvm::FoldingSetNodeID &id) {
@@ -4066,18 +4067,18 @@ class SILYieldInfo : public SILParameterInfo {
4066
4067
->getCanonicalType ());
4067
4068
}
4068
4069
4069
- CanType getYieldValueType (SILModule &M,
4070
- const SILFunctionType *fnType ) const {
4071
- return getArgumentType (M, fnType);
4070
+ CanType getYieldValueType (SILModule &M, const SILFunctionType *fnType,
4071
+ TypeExpansionContext context ) const {
4072
+ return getArgumentType (M, fnType, context );
4072
4073
}
4073
4074
4074
4075
// / Treating this yield info as a component of the given function
4075
4076
// / type, apply any substitutions from the function type to it to
4076
4077
// / get a substituted version of it, as you would get from
4077
4078
// / SILFunctionType::getUnsubstitutedType.
4078
- SILYieldInfo getUnsubstituted (SILModule &M,
4079
- const SILFunctionType *fnType ) const {
4080
- return getWithInterfaceType (getYieldValueType (M, fnType));
4079
+ SILYieldInfo getUnsubstituted (SILModule &M, const SILFunctionType *fnType,
4080
+ TypeExpansionContext context ) const {
4081
+ return getWithInterfaceType (getYieldValueType (M, fnType, context ));
4081
4082
}
4082
4083
};
4083
4084
@@ -4528,14 +4529,15 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4528
4529
// / this function depends on the current SIL stage and is known by
4529
4530
// / SILFunctionConventions. It may be a wider tuple that includes formally
4530
4531
// / indirect results.
4531
- SILType getDirectFormalResultsType (SILModule &M);
4532
+ SILType getDirectFormalResultsType (SILModule &M,
4533
+ TypeExpansionContext expansion);
4532
4534
4533
4535
// / Get a single non-address SILType for all SIL results regardless of whether
4534
4536
// / they are formally indirect. The actual SIL result type of an apply
4535
4537
// / instruction that calls this function depends on the current SIL stage and
4536
4538
// / is known by SILFunctionConventions. It may be a narrower tuple that omits
4537
4539
// / formally indirect results.
4538
- SILType getAllResultsSubstType (SILModule &M);
4540
+ SILType getAllResultsSubstType (SILModule &M, TypeExpansionContext expansion );
4539
4541
SILType getAllResultsInterfaceType ();
4540
4542
4541
4543
// / Does this function have a blessed Swift-native error result?
@@ -4678,12 +4680,13 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4678
4680
return getInvocationGenericSignature () && !getInvocationSubstitutions ();
4679
4681
}
4680
4682
4681
- CanType getSelfInstanceType (SILModule &M) const ;
4683
+ CanType getSelfInstanceType (SILModule &M, TypeExpansionContext context ) const ;
4682
4684
4683
4685
// / If this is a @convention(witness_method) function with a class
4684
4686
// / constrained self parameter, return the class constraint for the
4685
4687
// / Self type.
4686
- ClassDecl *getWitnessMethodClass (SILModule &M) const ;
4688
+ ClassDecl *getWitnessMethodClass (SILModule &M,
4689
+ TypeExpansionContext context) const ;
4687
4690
4688
4691
// / If this is a @convention(witness_method) function, return the conformance
4689
4692
// / for which the method is a witness. If it isn't that convention, return
@@ -4875,8 +4878,9 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4875
4878
return getExtInfo ().getDifferentiabilityKind ();
4876
4879
}
4877
4880
4878
- bool isNoReturnFunction (SILModule &M) const ; // Defined in SILType.cpp
4879
-
4881
+ bool isNoReturnFunction (SILModule &M, TypeExpansionContext context)
4882
+ const ; // Defined in SILType.cpp
4883
+
4880
4884
// / Create a SILFunctionType with the same structure as this one,
4881
4885
// / but with a different (or new) set of invocation substitutions.
4882
4886
// / The substitutions must have the same generic signature as this.
@@ -4956,7 +4960,8 @@ class SILFunctionType final : public TypeBase, public llvm::FoldingSetNode,
4956
4960
TypeExpansionContext context);
4957
4961
4958
4962
SILType substInterfaceType (SILModule &M,
4959
- SILType interfaceType) const ;
4963
+ SILType interfaceType,
4964
+ TypeExpansionContext context) const ;
4960
4965
4961
4966
// / Return the unsubstituted function type equivalent to this type; that is, the type that has the same
4962
4967
// / argument and result types as `this` type after substitutions, if any.
0 commit comments