File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 20
20
#include " expr.h"
21
21
#include " mp_arith.h"
22
22
#include " invariant.h"
23
+ #include " expr_cast.h"
23
24
24
25
class constant_exprt ;
25
26
@@ -1430,6 +1431,18 @@ inline pointer_typet &to_pointer_type(typet &type)
1430
1431
return static_cast <pointer_typet &>(type);
1431
1432
}
1432
1433
1434
+ template <>
1435
+ inline bool can_cast_type<pointer_typet>(const typet &type)
1436
+ {
1437
+ return type.id () == ID_pointer;
1438
+ }
1439
+
1440
+ inline void validate_type (const pointer_typet &type)
1441
+ {
1442
+ DATA_INVARIANT (!type.get (ID_width).empty (), " pointer must have width" );
1443
+ DATA_INVARIANT (type.get_width () > 0 , " pointer must have non-zero width" );
1444
+ }
1445
+
1433
1446
/* ! \brief The reference type
1434
1447
*/
1435
1448
class reference_typet :public pointer_typet
You can’t perform that action at this time.
0 commit comments