Skip to content

Commit e70d704

Browse files
committed
Minor style changes.
1 parent 3faf474 commit e70d704

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/SIL/TypeLowering.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -897,20 +897,18 @@ namespace {
897897
TC.getTypeLowering(origFnTy, getResilienceExpansion())
898898
});
899899
for (AutoDiffAssociatedFunctionKind kind :
900-
{AutoDiffAssociatedFunctionKind::JVP,
901-
AutoDiffAssociatedFunctionKind::VJP}) {
900+
{AutoDiffAssociatedFunctionKind::JVP,
901+
AutoDiffAssociatedFunctionKind::VJP}) {
902902
auto assocFnTy = origFnTy->getAutoDiffAssociatedFunctionType(
903903
paramIndices, 0, kind, TC,
904904
LookUpConformanceInModule(&TC.M));
905905
auto silTy = SILType::getPrimitiveObjectType(assocFnTy);
906-
auto extractee = DifferentiableFunctionExtractee(kind);
907-
908-
// A bug caused by implicit conversions caused us to get the wrong
909-
// extractee, so assert that we have the right extractee to prevent
910-
// reoccurrence of the bug.
911-
assert(extractee.getExtracteeAsAssociatedFunction() ==
912-
Optional<AutoDiffAssociatedFunctionKind>(kind));
913-
906+
DifferentiableFunctionExtractee extractee(kind);
907+
// Assert that we have the right extractee. A terrible bug in the past
908+
// was caused by implicit conversions from `unsigned` to
909+
// `DifferentiableFunctionExtractee` which resulted into a wrong
910+
// extractee.
911+
assert(extractee.getExtracteeAsAssociatedFunction() == kind);
914912
children.push_back(Child{
915913
extractee, TC.getTypeLowering(silTy, getResilienceExpansion())});
916914
}

0 commit comments

Comments
 (0)