@@ -431,7 +431,7 @@ void c_typecheck_baset::typecheck_expr_main(exprt &expr)
431
431
// This is one of the few places where it's detectable
432
432
// that we are using "bool" for boolean operators instead
433
433
// of "int". We convert for this reason.
434
- if (op.type (). id () == ID_bool )
434
+ if (op.is_boolean () )
435
435
op = typecast_exprt (op, signed_int_type ());
436
436
437
437
irept::subt &generic_associations=
@@ -960,7 +960,7 @@ void c_typecheck_baset::typecheck_expr_sizeof(exprt &expr)
960
960
// This is one of the few places where it's detectable
961
961
// that we are using "bool" for boolean operators instead
962
962
// of "int". We convert for this reason.
963
- if (op.type (). id () == ID_bool )
963
+ if (op.is_boolean () )
964
964
type = signed_int_type ();
965
965
else
966
966
type = op.type ();
@@ -1102,7 +1102,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
1102
1102
// This is one of the few places where it's detectable
1103
1103
// that we are using "bool" for boolean operators instead
1104
1104
// of "int". We convert for this reason.
1105
- if (op.type (). id () == ID_bool )
1105
+ if (op.is_boolean () )
1106
1106
op = typecast_exprt (op, signed_int_type ());
1107
1107
1108
1108
// we need to find a member with the right type
@@ -1718,7 +1718,7 @@ void c_typecheck_baset::typecheck_expr_address_of(exprt &expr)
1718
1718
throw 0 ;
1719
1719
}
1720
1720
1721
- if (op.type (). id () == ID_bool )
1721
+ if (op.is_boolean () )
1722
1722
{
1723
1723
error ().source_location = expr.source_location ();
1724
1724
error () << " cannot take address of a single bit" << eom;
@@ -4387,7 +4387,7 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
4387
4387
{
4388
4388
implicit_typecast_arithmetic (op0, op1);
4389
4389
if (
4390
- op1.type (). id () == ID_bool || op1.type ().id () == ID_c_bool ||
4390
+ op1.is_boolean () || op1.type ().id () == ID_c_bool ||
4391
4391
op1.type ().id () == ID_c_enum_tag || op1.type ().id () == ID_unsignedbv ||
4392
4392
op1.type ().id () == ID_signedbv || op1.type ().id () == ID_c_bit_field)
4393
4393
{
@@ -4453,7 +4453,7 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
4453
4453
implicit_typecast_arithmetic (op1);
4454
4454
4455
4455
if (
4456
- is_number (op1.type ()) || op1.type (). id () == ID_bool ||
4456
+ is_number (op1.type ()) || op1.is_boolean () ||
4457
4457
op1.type ().id () == ID_c_bool || op1.type ().id () == ID_c_enum_tag)
4458
4458
{
4459
4459
op1 = typecast_exprt (op1, o_type0);
@@ -4464,22 +4464,24 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
4464
4464
o_type0.id ()==ID_c_bool)
4465
4465
{
4466
4466
implicit_typecast_arithmetic (op0, op1);
4467
- if (op1. type (). id ()==ID_bool ||
4468
- op1.type ().id ()== ID_c_bool ||
4469
- op1.type ().id ()== ID_c_enum_tag ||
4470
- op1.type ().id ()==ID_unsignedbv ||
4471
- op1. type (). id ()==ID_signedbv)
4467
+ if (
4468
+ op1. is_boolean () || op1.type ().id () == ID_c_bool ||
4469
+ op1.type ().id () == ID_c_enum_tag || op1. type (). id () == ID_unsignedbv ||
4470
+ op1.type ().id () == ID_signedbv)
4471
+ {
4472
4472
return ;
4473
+ }
4473
4474
}
4474
4475
else
4475
4476
{
4476
4477
implicit_typecast_arithmetic (op0, op1);
4477
4478
4478
- if (is_number (op1. type ()) ||
4479
- op1.type (). id ()==ID_bool ||
4480
- op1.type ().id ()== ID_c_bool ||
4481
- op1. type (). id ()==ID_c_enum_tag)
4479
+ if (
4480
+ is_number ( op1.type ()) || op1. is_boolean () ||
4481
+ op1.type ().id () == ID_c_bool || op1. type (). id () == ID_c_enum_tag)
4482
+ {
4482
4483
return ;
4484
+ }
4483
4485
}
4484
4486
}
4485
4487
0 commit comments