File tree 1 file changed +8
-8
lines changed 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -1245,6 +1245,12 @@ class unsignedbv_typet:public bitvector_typet
1245
1245
constant_exprt smallest_expr () const ;
1246
1246
constant_exprt zero_expr () const ;
1247
1247
constant_exprt largest_expr () const ;
1248
+
1249
+ void check (const validation_modet vm = validation_modet::INVARIANT) const
1250
+ {
1251
+ DATA_CHECK (
1252
+ !get (ID_width).empty (), " unsigned bitvector type must have width" );
1253
+ }
1248
1254
};
1249
1255
1250
1256
// / Check whether a reference to a typet is a \ref unsignedbv_typet.
@@ -1256,12 +1262,6 @@ inline bool can_cast_type<unsignedbv_typet>(const typet &type)
1256
1262
return type.id () == ID_unsignedbv;
1257
1263
}
1258
1264
1259
- inline void validate_type (const unsignedbv_typet &type)
1260
- {
1261
- DATA_INVARIANT (
1262
- !type.get (ID_width).empty (), " unsigned bitvector type must have width" );
1263
- }
1264
-
1265
1265
// / \brief Cast a typet to an \ref unsignedbv_typet
1266
1266
// /
1267
1267
// / This is an unchecked conversion. \a type must be known to be \ref
@@ -1274,7 +1274,7 @@ inline const unsignedbv_typet &to_unsignedbv_type(const typet &type)
1274
1274
{
1275
1275
PRECONDITION (can_cast_type<unsignedbv_typet>(type));
1276
1276
const unsignedbv_typet &ret = static_cast <const unsignedbv_typet &>(type);
1277
- validate_type ( ret);
1277
+ ret. check ( );
1278
1278
return ret;
1279
1279
}
1280
1280
@@ -1283,7 +1283,7 @@ inline unsignedbv_typet &to_unsignedbv_type(typet &type)
1283
1283
{
1284
1284
PRECONDITION (can_cast_type<unsignedbv_typet>(type));
1285
1285
unsignedbv_typet &ret = static_cast <unsignedbv_typet &>(type);
1286
- validate_type ( ret);
1286
+ ret. check ( );
1287
1287
return ret;
1288
1288
}
1289
1289
You can’t perform that action at this time.
0 commit comments