@@ -514,26 +514,19 @@ void LabeledConditionalStmt::setCond(StmtCondition e) {
514514// / or `let self = self` condition.
515515// / - If `requiresCaptureListRef` is `true`, additionally requires that the
516516// / RHS of the self condition references a var defined in a capture list.
517- // / - If `requireLoadExpr` is `true`, additionally requires that the RHS of
518- // / the self condition is a `LoadExpr`.
519517bool LabeledConditionalStmt::rebindsSelf (ASTContext &Ctx,
520- bool requiresCaptureListRef,
521- bool requireLoadExpr) const {
522- return llvm::any_of (getCond (), [&Ctx, requiresCaptureListRef,
523- requireLoadExpr](const auto &cond) {
524- return cond.rebindsSelf (Ctx, requiresCaptureListRef, requireLoadExpr);
518+ bool requiresCaptureListRef) const {
519+ return llvm::any_of (getCond (), [&Ctx, requiresCaptureListRef](const auto &cond) {
520+ return cond.rebindsSelf (Ctx, requiresCaptureListRef);
525521 });
526522}
527523
528524// / Whether or not this conditional stmt rebinds self with a `let self`
529525// / or `let self = self` condition.
530526// / - If `requiresCaptureListRef` is `true`, additionally requires that the
531527// / RHS of the self condition references a var defined in a capture list.
532- // / - If `requireLoadExpr` is `true`, additionally requires that the RHS of
533- // / the self condition is a `LoadExpr`.
534528bool StmtConditionElement::rebindsSelf (ASTContext &Ctx,
535- bool requiresCaptureListRef,
536- bool requireLoadExpr) const {
529+ bool requiresCaptureListRef) const {
537530 auto pattern = getPatternOrNull ();
538531 if (!pattern) {
539532 return false ;
@@ -561,10 +554,6 @@ bool StmtConditionElement::rebindsSelf(ASTContext &Ctx,
561554 return false ;
562555 }
563556
564- if (requireLoadExpr && !isa<LoadExpr>(exprToCheckForDRE)) {
565- return false ;
566- }
567-
568557 if (auto *load = dyn_cast<LoadExpr>(exprToCheckForDRE)) {
569558 exprToCheckForDRE = load->getSubExpr ();
570559 }
0 commit comments