Remove the "test" parameter from test_expr.

The parameter became redundant at some stage.
This commit is contained in:
Bill Currie 2011-01-27 08:31:51 +09:00
parent f7d60397fb
commit a6e65488ec
3 changed files with 6 additions and 9 deletions

View file

@ -516,7 +516,7 @@ void convert_short (expr_t *e);
void convert_short_int (expr_t *e);
void convert_nil (expr_t *e, struct type_s *t);
expr_t *test_expr (expr_t *e, int test);
expr_t *test_expr (expr_t *e);
void backpatch (ex_list_t *list, expr_t *label);
expr_t *convert_bool (expr_t *e, int block);
expr_t *bool_expr (int op, expr_t *label, expr_t *e1, expr_t *e2);

View file

@ -780,7 +780,7 @@ field_expr (expr_t *e1, expr_t *e2)
}
expr_t *
test_expr (expr_t *e, int test)
test_expr (expr_t *e)
{
static float zero[4] = {0, 0, 0, 0};
expr_t *new = 0;
@ -789,9 +789,6 @@ test_expr (expr_t *e, int test)
if (e->type == ex_error)
return e;
if (!test)
return unary_expr ('!', e);
type = extract_type (e);
if (e->type == ex_error)
return e;
@ -918,7 +915,7 @@ convert_bool (expr_t *e, int block)
e = unary_expr ('!', e);
}
if (e->type != ex_bool) {
e = test_expr (e, 1);
e = test_expr (e);
if (e->type == ex_error)
return e;
if (is_integer_val (e)) {
@ -1199,8 +1196,8 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
return field_expr (e1, e2);
if (op == OR || op == AND) {
e1 = test_expr (e1, true);
e2 = test_expr (e2, true);
e1 = test_expr (e1);
e2 = test_expr (e2);
}
if (e1->type == ex_error)

View file

@ -382,7 +382,7 @@ switch_expr (switch_block_t *switch_block, expr_t *break_label,
for (l = labels; *l; l++) {
expr_t *cmp = binary_expr (EQ, sw_val, (*l)->value);
expr_t *test = new_binary_expr ('i',
test_expr (cmp, 1),
test_expr (cmp),
(*l)->label);
append_expr (sw, test);