@@ -431,7 +431,7 @@ void c_typecheck_baset::typecheck_expr_main(exprt &expr)
431431 // This is one of the few places where it's detectable
432432 // that we are using "bool" for boolean operators instead
433433 // of "int". We convert for this reason.
434- if (op.type (). id () == ID_bool )
434+ if (op.is_boolean () )
435435 op = typecast_exprt (op, signed_int_type ());
436436
437437 irept::subt &generic_associations=
@@ -960,7 +960,7 @@ void c_typecheck_baset::typecheck_expr_sizeof(exprt &expr)
960960 // This is one of the few places where it's detectable
961961 // that we are using "bool" for boolean operators instead
962962 // of "int". We convert for this reason.
963- if (op.type (). id () == ID_bool )
963+ if (op.is_boolean () )
964964 type = signed_int_type ();
965965 else
966966 type = op.type ();
@@ -1102,7 +1102,7 @@ void c_typecheck_baset::typecheck_expr_typecast(exprt &expr)
11021102 // This is one of the few places where it's detectable
11031103 // that we are using "bool" for boolean operators instead
11041104 // of "int". We convert for this reason.
1105- if (op.type (). id () == ID_bool )
1105+ if (op.is_boolean () )
11061106 op = typecast_exprt (op, signed_int_type ());
11071107
11081108 // we need to find a member with the right type
@@ -1718,7 +1718,7 @@ void c_typecheck_baset::typecheck_expr_address_of(exprt &expr)
17181718 throw 0 ;
17191719 }
17201720
1721- if (op.type (). id () == ID_bool )
1721+ if (op.is_boolean () )
17221722 {
17231723 error ().source_location = expr.source_location ();
17241724 error () << " cannot take address of a single bit" << eom;
@@ -4387,7 +4387,7 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
43874387 {
43884388 implicit_typecast_arithmetic (op0, op1);
43894389 if (
4390- op1.type (). id () == ID_bool || op1.type ().id () == ID_c_bool ||
4390+ op1.is_boolean () || op1.type ().id () == ID_c_bool ||
43914391 op1.type ().id () == ID_c_enum_tag || op1.type ().id () == ID_unsignedbv ||
43924392 op1.type ().id () == ID_signedbv || op1.type ().id () == ID_c_bit_field)
43934393 {
@@ -4453,7 +4453,7 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
44534453 implicit_typecast_arithmetic (op1);
44544454
44554455 if (
4456- is_number (op1.type ()) || op1.type (). id () == ID_bool ||
4456+ is_number (op1.type ()) || op1.is_boolean () ||
44574457 op1.type ().id () == ID_c_bool || op1.type ().id () == ID_c_enum_tag)
44584458 {
44594459 op1 = typecast_exprt (op1, o_type0);
@@ -4464,22 +4464,24 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
44644464 o_type0.id ()==ID_c_bool)
44654465 {
44664466 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+ {
44724472 return ;
4473+ }
44734474 }
44744475 else
44754476 {
44764477 implicit_typecast_arithmetic (op0, op1);
44774478
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+ {
44824483 return ;
4484+ }
44834485 }
44844486 }
44854487
0 commit comments