mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge remote-tracking branch 'origin/master' into master-rebranch
This commit is contained in:
@@ -3766,6 +3766,17 @@ static uint8_t getRawStableParameterConvention(swift::ParameterConvention pc) {
|
||||
llvm_unreachable("bad parameter convention kind");
|
||||
}
|
||||
|
||||
/// Translate from AST SILParameterDifferentiability enum to the Serialization
|
||||
/// enum values, which are guaranteed to be stable.
|
||||
static uint8_t
|
||||
getRawSILParameterDifferentiability(swift::SILParameterDifferentiability pd) {
|
||||
switch (pd) {
|
||||
SIMPLE_CASE(SILParameterDifferentiability, DifferentiableOrNotApplicable)
|
||||
SIMPLE_CASE(SILParameterDifferentiability, NotDifferentiable)
|
||||
}
|
||||
llvm_unreachable("bad parameter differentiability kind");
|
||||
}
|
||||
|
||||
/// Translate from the AST ResultConvention enum to the
|
||||
/// Serialization enum values, which are guaranteed to be stable.
|
||||
static uint8_t getRawStableResultConvention(swift::ResultConvention rc) {
|
||||
@@ -4075,6 +4086,9 @@ public:
|
||||
variableData.push_back(S.addTypeRef(param.getInterfaceType()));
|
||||
unsigned conv = getRawStableParameterConvention(param.getConvention());
|
||||
variableData.push_back(TypeID(conv));
|
||||
if (fnTy->isDifferentiable())
|
||||
variableData.push_back(TypeID(
|
||||
getRawSILParameterDifferentiability(param.getDifferentiability())));
|
||||
}
|
||||
for (auto yield : fnTy->getYields()) {
|
||||
variableData.push_back(S.addTypeRef(yield.getInterfaceType()));
|
||||
|
||||
Reference in New Issue
Block a user