Merge remote-tracking branch 'origin/master' into master-rebranch

This commit is contained in:
swift-ci
2020-01-24 10:24:34 -08:00
32 changed files with 730 additions and 125 deletions

View File

@@ -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()));