|
CBMC
|
Lowering of GCC's conditional expression with omitted middle operand. More...
#include <util/invariant.h>#include <util/std_code.h>#include <util/std_expr.h>#include <util/std_types.h>Go to the source code of this file.
Functions | |
| if_exprt | lower_gcc_conditional_expression (const side_effect_exprt &expr) |
| Lower a single GCC conditional expression with omitted middle operand. | |
| void | lower_gcc_conditional_expressions (exprt &expr) |
Recursively lower all GCC conditional expressions with omitted middle operand in expr. | |
Lowering of GCC's conditional expression with omitted middle operand.
GCC's a ? : b is rewritten into an equivalent if-expression.
Definition in file gcc_conditional_expression.h.
|
inline |
Lower a single GCC conditional expression with omitted middle operand.
Rewrites the side effect a ? : b into the equivalent if-expression (a != 0) ? a : b. This drops the guarantee that a is evaluated only once, so it is only valid where a has no side effects – i.e. in constant contexts, or after side effects have already been removed (as in goto conversion).
| expr | a side_effect_exprt whose statement is ID_gcc_conditional_expression and which has exactly two operands |
Definition at line 32 of file gcc_conditional_expression.h.
|
inline |
Recursively lower all GCC conditional expressions with omitted middle operand in expr.
Rewrites every side effect a ? : b into the if-expression (a != 0) ? a : b. Only valid in constant contexts, where the once-only evaluation of a is immaterial (there are no side effects), so that the simplifier can fold the result.
Definition at line 52 of file gcc_conditional_expression.h.