File tree 1 file changed +7
-6
lines changed
lib/SILOptimizer/Mandatory
1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -478,10 +478,8 @@ static SILValue reapplyFunctionConversion(
478
478
479
479
SILFunction *DifferentiationTransformer::getUnwrappedCurryThunkFunction (
480
480
SILFunction *originalFn) {
481
- auto *abstractCE = originalFn->getDeclRef ().getAbstractClosureExpr ();
482
- if (abstractCE == nullptr )
483
- return nullptr ;
484
- auto *autoCE = dyn_cast<AutoClosureExpr>(abstractCE);
481
+ auto *autoCE = dyn_cast_or_null<AutoClosureExpr>(
482
+ originalFn->getDeclRef ().getAbstractClosureExpr ());
485
483
if (autoCE == nullptr )
486
484
return nullptr ;
487
485
@@ -517,8 +515,11 @@ SILFunction *DifferentiationTransformer::getUnwrappedCurryThunkFunction(
517
515
// parameters are not handled since we can't now construct a test case
518
516
// for that due to the crash
519
517
// https://github.com/swiftlang/swift/issues/77613
520
- if (currentAFD->hasCurriedSelf ())
521
- afdToSILFn.insert ({currentAFD, ¤tFunc});
518
+ if (currentAFD->hasCurriedSelf ()) {
519
+ auto [_, wasEmplace] =
520
+ afdToSILFn.try_emplace (currentAFD, ¤tFunc);
521
+ assert (wasEmplace);
522
+ }
522
523
}
523
524
}
524
525
You can’t perform that action at this time.
0 commit comments