mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Optimizer: Use true / false instead of 1 / 0 for bool parameters (2)
Changes done with Coccinelle:
@r1@
identifier F;
identifier p;
typedef bool;
type T;
parameter list [n1] PL1;
parameter list [n2] PL2;
@@
T F(PL1, bool p, PL2);
@r2@
identifier r1.F;
expression list [r1.n1] EL1;
expression list [r1.n2] EL2;
@@
F(EL1,
(
- 1
+ true
|
- 0
+ false
)
, EL2)
This commit is contained in:
committed by
Tim Düsterhus
parent
ed4537df9f
commit
525cc9a1ca
@@ -240,21 +240,21 @@ static zend_always_inline void zend_ssa_rename_defs_of_instr(zend_ssa *ssa, zend
|
||||
/* Rename def to use if possible. Mark variable as not defined otherwise. */
|
||||
if (ssa_op->op1_def >= 0) {
|
||||
if (ssa_op->op1_use >= 0) {
|
||||
zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, 1);
|
||||
zend_ssa_rename_var_uses(ssa, ssa_op->op1_def, ssa_op->op1_use, true);
|
||||
}
|
||||
ssa->vars[ssa_op->op1_def].definition = -1;
|
||||
ssa_op->op1_def = -1;
|
||||
}
|
||||
if (ssa_op->op2_def >= 0) {
|
||||
if (ssa_op->op2_use >= 0) {
|
||||
zend_ssa_rename_var_uses(ssa, ssa_op->op2_def, ssa_op->op2_use, 1);
|
||||
zend_ssa_rename_var_uses(ssa, ssa_op->op2_def, ssa_op->op2_use, true);
|
||||
}
|
||||
ssa->vars[ssa_op->op2_def].definition = -1;
|
||||
ssa_op->op2_def = -1;
|
||||
}
|
||||
if (ssa_op->result_def >= 0) {
|
||||
if (ssa_op->result_use >= 0) {
|
||||
zend_ssa_rename_var_uses(ssa, ssa_op->result_def, ssa_op->result_use, 1);
|
||||
zend_ssa_rename_var_uses(ssa, ssa_op->result_def, ssa_op->result_use, true);
|
||||
}
|
||||
ssa->vars[ssa_op->result_def].definition = -1;
|
||||
ssa_op->result_def = -1;
|
||||
|
||||
Reference in New Issue
Block a user