Skip to content

Commit ee8ad7b

Browse files
authored
[AutoDiff] NFC: silence no-asserts unused variable warning. (swiftlang#33629)
1 parent 6e6de51 commit ee8ad7b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/SILOptimizer/Differentiation/PullbackCloner.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,12 +2035,10 @@ void PullbackCloner::Implementation::accumulateAdjointForOptional(
20352035
SILBasicBlock *bb, SILValue optionalValue, SILValue wrappedAdjoint) {
20362036
auto pbLoc = getPullback().getLocation();
20372037
// Handle `switch_enum` on `Optional`.
2038-
auto *optionalEnumDecl = getASTContext().getOptionalDecl();
2039-
auto optionalTy = optionalValue->getType();
2040-
assert(optionalTy.getASTType().getEnumOrBoundGenericEnum() ==
2041-
optionalEnumDecl);
20422038
// `Optional<T>`
2043-
optionalTy = remapType(optionalTy);
2039+
auto optionalTy = remapType(optionalValue->getType());
2040+
assert(optionalTy.getASTType().getEnumOrBoundGenericEnum() ==
2041+
getASTContext().getOptionalDecl());
20442042
// `T`
20452043
auto wrappedType = optionalTy.getOptionalObjectType();
20462044
// `T.TangentVector`

0 commit comments

Comments
 (0)