File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -482,27 +482,22 @@ bool StmtConditionElement::rebindsSelf(ASTContext &Ctx,
482
482
return false ;
483
483
}
484
484
485
- // The RHS could be a `LoadExpr` or `DeclRefExpr`
486
- Expr *loadExprSubExpr = nullptr ;
487
- if (auto LE = dyn_cast<LoadExpr>(exprToCheckForDRE)) {
488
- loadExprSubExpr = LE->getSubExpr ();
485
+ if (requireLoadExpr && !isa<LoadExpr>(exprToCheckForDRE)) {
486
+ return false ;
489
487
}
490
488
491
- if (requireLoadExpr) {
492
- exprToCheckForDRE = loadExprSubExpr;
493
- } else {
494
- if (loadExprSubExpr) {
495
- exprToCheckForDRE = loadExprSubExpr;
496
- }
497
- exprToCheckForDRE = exprToCheckForDRE->getSemanticsProvidingExpr ();
489
+ if (auto *load = dyn_cast<LoadExpr>(exprToCheckForDRE)) {
490
+ exprToCheckForDRE = load->getSubExpr ();
498
491
}
499
492
500
- DeclRefExpr *condDRE = dyn_cast_or_null<DeclRefExpr>(exprToCheckForDRE);
501
- if (!condDRE || !condDRE->getDecl ()->hasName ()) {
502
- return false ;
493
+ if (auto *DRE = dyn_cast<DeclRefExpr>(
494
+ exprToCheckForDRE->getSemanticsProvidingExpr ())) {
495
+ auto *decl = DRE->getDecl ();
496
+ return decl && decl->hasName () ? decl->getName ().isSimpleName (Ctx.Id_self )
497
+ : false ;
503
498
}
504
499
505
- return condDRE-> getDecl ()-> getName (). isSimpleName (Ctx. Id_self ) ;
500
+ return false ;
506
501
}
507
502
508
503
PoundAvailableInfo *
You can’t perform that action at this time.
0 commit comments