File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1022,6 +1022,29 @@ class object_size_exprt : public unary_exprt
1022
1022
}
1023
1023
};
1024
1024
1025
+ // / \brief Cast an exprt to a \ref object_size_exprt
1026
+ // /
1027
+ // / \a expr must be known to be \ref object_size_exprt.
1028
+ // /
1029
+ // / \param expr: Source expression
1030
+ // / \return Object of type \ref object_size_exprt
1031
+ inline const object_size_exprt &to_object_size_expr (const exprt &expr)
1032
+ {
1033
+ PRECONDITION (expr.id () == ID_object_size);
1034
+ const object_size_exprt &ret = static_cast <const object_size_exprt &>(expr);
1035
+ validate_expr (ret);
1036
+ return ret;
1037
+ }
1038
+
1039
+ // / \copydoc to_object_size_expr(const exprt &)
1040
+ inline object_size_exprt &to_object_size_expr (exprt &expr)
1041
+ {
1042
+ PRECONDITION (expr.id () == ID_object_size);
1043
+ object_size_exprt &ret = static_cast <object_size_exprt &>(expr);
1044
+ validate_expr (ret);
1045
+ return ret;
1046
+ }
1047
+
1025
1048
template <>
1026
1049
inline bool can_cast_expr<object_size_exprt>(const exprt &base)
1027
1050
{
You can’t perform that action at this time.
0 commit comments