File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -2052,6 +2052,36 @@ class bitnot_exprt:public unary_exprt
2052
2052
}
2053
2053
};
2054
2054
2055
+ /* ! \brief Cast a generic exprt to a \ref bitnot_exprt
2056
+ *
2057
+ * This is an unchecked conversion. \a expr must be known to be \ref
2058
+ * bitnot_exprt.
2059
+ *
2060
+ * \param expr Source expression
2061
+ * \return Object of type \ref bitnot_exprt
2062
+ *
2063
+ * \ingroup gr_std_expr
2064
+ */
2065
+ inline const bitnot_exprt &to_bitnot_expr (const exprt &expr)
2066
+ {
2067
+ PRECONDITION (expr.id ()==ID_bitnot);
2068
+ // DATA_INVARIANT(expr.operands().size()==1,
2069
+ // "Bit-wise not must have one operand");
2070
+ return static_cast <const bitnot_exprt &>(expr);
2071
+ }
2072
+
2073
+ /* ! \copydoc to_bitnot_expr(const exprt &)
2074
+ * \ingroup gr_std_expr
2075
+ */
2076
+ inline bitnot_exprt &to_bitnot_expr (exprt &expr)
2077
+ {
2078
+ PRECONDITION (expr.id ()==ID_bitnot);
2079
+ // DATA_INVARIANT(expr.operands().size()==1,
2080
+ // "Bit-wise not must have one operand");
2081
+ return static_cast <bitnot_exprt &>(expr);
2082
+ }
2083
+
2084
+
2055
2085
/* ! \brief Bit-wise OR
2056
2086
*/
2057
2087
class bitor_exprt :public multi_ary_exprt
You can’t perform that action at this time.
0 commit comments