Commit a791a76
committed
Share the comparison and logical operand lowering
The six comparison handlers repeated the same four-step preamble --
lower operands, refuse complex ordering, promote logicals as integers,
conform shapes -- and `&`/`|` shared a registration whose body then
switched on the operator to pick `.and.`/`.or.`. Both collapse into one
lowering helper each (lower_comparison_operands(),
lower_logical_operands()), leaving every handler as its Fortran spelling
plus the result mode. `&` and `|` become separate handlers, so nothing
dispatches on the call name.
The short-circuit trio is renamed to say what it does rather than which
operators reach it: check_short_circuit_operand(),
is_eager_safe_condition(), and lower_short_circuit_operator(), which
`&&` and `||` now both delegate to.
check_ordered_operands(), added with the complex-ordering refusal, is
absorbed into lower_comparison_operands() -- the refusal was the only
thing it shared. Emitted Fortran is unchanged.1 parent 3d6be27 commit a791a76
1 file changed
Lines changed: 152 additions & 174 deletions
0 commit comments