File tree 3 files changed +21
-1
lines changed
3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1496,7 +1496,7 @@ void c_typecheck_baset::typecheck_c_bit_field_type(c_bit_field_typet &type)
1496
1496
<< " bit field width is negative" ;
1497
1497
}
1498
1498
1499
- type.set_width (numeric_cast_v<std:: size_t >(i) );
1499
+ type.width (i );
1500
1500
type.remove (ID_size);
1501
1501
}
1502
1502
Original file line number Diff line number Diff line change 12
12
13
13
#include " std_types.h"
14
14
15
+ #include " arith_tools.h"
15
16
#include " c_types.h"
16
17
#include " namespace.h"
17
18
#include " std_expr.h"
@@ -154,6 +155,16 @@ bool is_rvalue_reference(const typet &type)
154
155
type.get_bool (ID_C_rvalue_reference);
155
156
}
156
157
158
+ std::size_t bitvector_typet::width () const
159
+ {
160
+ return get_size_t (ID_width);
161
+ }
162
+
163
+ void bitvector_typet::width (const mp_integer &width)
164
+ {
165
+ set_width (numeric_cast_v<std::size_t >(width));
166
+ }
167
+
157
168
void range_typet::set_from (const mp_integer &from)
158
169
{
159
170
set (ID_from, integer2string (from));
Original file line number Diff line number Diff line change @@ -917,16 +917,25 @@ class bitvector_typet : public typet
917
917
set_width (width);
918
918
}
919
919
920
+ bitvector_typet (const irep_idt &_id, mp_integer _width) : typet(_id)
921
+ {
922
+ width (_width);
923
+ }
924
+
920
925
std::size_t get_width () const
921
926
{
922
927
return get_size_t (ID_width);
923
928
}
924
929
930
+ std::size_t width () const ;
931
+
925
932
void set_width (std::size_t width)
926
933
{
927
934
set_size_t (ID_width, width);
928
935
}
929
936
937
+ void width (const mp_integer &);
938
+
930
939
static void check (
931
940
const typet &type,
932
941
const validation_modet vm = validation_modet::INVARIANT)
You can’t perform that action at this time.
0 commit comments