================
@@ -339,6 +339,12 @@ void TransferFunctions::Visit(Stmt *S) {
AddLiveExpr(val.liveExprs, LV.ESetFact, CO->getFalseExpr());
return;
}
+ case Stmt::BinaryOperatorClass: {
+ auto const *BO = cast<BinaryOperator>(S);
+ if (BO->isLogicalOp())
+ AddAllConditionalTerms(val.liveExprs, LV.ESetFact, BO);
----------------
NagyDonat wrote:
```suggestion
if (BO->isLogicalOp()) {
AddAllConditionalTerms(val.liveExprs, LV.ESetFact, BO);
return;
}
```
Using `break;` instead of `return;` means that the loop over `S->children()` is
also executed -- which is necessary for non-logical binary operators, but
completely redundant and a bit surprising for a logical operator.
Consider adding a `return;` in the `if` here – this is not necessary for
correct behavior, but perhaps makes the intent more clear.
https://github.com/llvm/llvm-project/pull/231419
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits