Skip to content

Commit 9794b8f

Browse files
committed
Remove obsolete functions is_pointer(), is_struct(), etc. from std_expr.h
A previous commit introduced e.g. function is_pointer() to check type.id() == ID_pointer. These have become obsolete as these expressions are now used directly.
1 parent 08d1f64 commit 9794b8f

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

src/util/c_types_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ inline bool is_c_int_derivate(const typet &type)
4949
/// of the pointer has been a char type in the c program.
5050
inline bool is_c_char_pointer(const typet &type)
5151
{
52-
return is_pointer(type) && is_c_char(type.subtype());
52+
return type.id() == ID_pointer && is_c_char(type.subtype());
5353
}
5454

5555
/// This function checks, whether type is a pointer and the target type
5656
/// has been some kind of int type in the c program.
5757
/// is_c_int_derivate answers is used for checking the int type.
5858
inline bool is_c_int_derivate_pointer(const typet &type)
5959
{
60-
return is_pointer(type) && is_c_int_derivate(type.subtype());
60+
return type.id() == ID_pointer && is_c_int_derivate(type.subtype());
6161
}
6262

6363
/// This function checks, whether the type
@@ -73,7 +73,7 @@ inline bool is_c_enum(const typet &type)
7373
/// \param c_enum the enum type memeber_name is supposed to be part of.
7474
/// \return value a constant, that could be assigned as value for an expression
7575
/// with type c_enum.
76-
constant_exprt convert_memeber_name_to_enum_value(
76+
constant_exprt convert_member_name_to_enum_value(
7777
const std::string &member_name,
7878
const c_enum_typet &c_enum)
7979
{

src/util/std_types.h

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,6 @@ inline bool can_cast_type<struct_typet>(const typet &type)
313313
return type.id() == ID_struct;
314314
}
315315

316-
/// This method tests,
317-
/// if the given typet is a struct
318-
inline bool is_struct(const typet &type)
319-
{
320-
return type.id() == ID_struct;
321-
}
322-
323316
/// \brief Cast a typet to a \ref struct_typet
324317
///
325318
/// This is an unchecked conversion. \a type must be known to be \ref
@@ -1015,12 +1008,6 @@ class array_typet:public type_with_subtypet
10151008
return size().is_nil();
10161009
}
10171010
};
1018-
/// This method tests,
1019-
/// if the given typet is an array_typet
1020-
inline bool is_array(const typet &type)
1021-
{
1022-
return type.id() == ID_array;
1023-
}
10241011

10251012
/// Check whether a reference to a typet is a \ref array_typet.
10261013
/// \param type: Source type.
@@ -1569,18 +1556,11 @@ inline pointer_typet &to_pointer_type(typet &type)
15691556
return static_cast<pointer_typet &>(type);
15701557
}
15711558

1572-
/// This method tests,
1573-
/// if the given typet is a pointer.
1574-
inline bool is_pointer(const typet &type)
1575-
{
1576-
return type.id() == ID_pointer;
1577-
}
1578-
15791559
/// This method tests,
15801560
/// if the given typet is a pointer of type void.
15811561
inline bool is_void_pointer(const typet &type)
15821562
{
1583-
return is_pointer(type) && type.subtype().id() == ID_empty;
1563+
return type.id() == ID_pointer && type.subtype().id() == ID_empty;
15841564
}
15851565

15861566
/// The reference type

0 commit comments

Comments
 (0)