|
ESBMC
Efficient SMT-based Context-Bounded Model Checker
|
clang C adjuster class for: More...
#include <clang_c_adjust.h>
Public Member Functions | |
| clang_c_adjust (contextt &_context) | |
| virtual | ~clang_c_adjust ()=default |
| bool | adjust () |
| void | set_irep2_owns_arms () |
| Hand the index rewrite to the IREP2 adjuster. | |
Static Public Member Functions | |
| static exprt | declare_gcc_polymorphic_builtin (const symbol_exprt &callee, const exprt::operandst &arguments, const locationt &call_location, contextt &context) |
Declare the concrete instance of the GCC __sync_* / C11 __c11_atomic_* polymorphic builtin that callee and arguments select, adding its parameter symbols and its synthesised body to context on first use. | |
Protected Member Functions | |
| bool | has_single_arithmetic_argument (const side_effect_expr_function_callt &expr) const |
| methods for symbol adjustment | |
| bool | shadows_user_definition (const irep_idt &identifier, const exprt &f_op) const |
| True when a name-matched builtin lowering would discard a definition the program supplies, in which case the definition wins. | |
| virtual void | adjust_symbol (symbolt &symbol) |
| void | adjust_type (typet &type) |
| methods for type (typet) adjustment | |
| void | adjust_expr (exprt &expr) |
| methods for expression (exprt) adjustment and other IRs derived from exprt | |
| void | adjust_base_to_derived (exprt &expr) |
| void | adjust_derived_to_base (exprt &expr, const irep_idt &base_id) |
| void | adjust_call_argument (exprt &arg) |
| void | adjust_struct (exprt &expr) |
| void | adjust_ptr_mem (exprt &expr) |
| void | adjust_side_effect_assignment (exprt &expr) |
| virtual void | adjust_side_effect_function_call (side_effect_expr_function_callt &expr) |
| void | adjust_side_effect_statement_expression (side_effect_exprt &expr) |
| virtual void | adjust_member (member_exprt &expr) |
| void | adjust_expr_binary_arithmetic (exprt &expr) |
| bool | lower_complex_binary_arithmetic (exprt &expr) |
| Rewrite a binary arithmetic expression over complex operands into the component-level form, in place. | |
| bool | lower_complex_compound_assignment (exprt &expr) |
| A compound assignment over a complex operand has to be expanded here. | |
| void | adjust_expr_unary_complex (exprt &expr) |
| void | bind_sideeffect_operands (exprt &expr, code_blockt &block) |
| void | finish_complex_lowering (exprt &expr, exprt &result, code_blockt &block) |
| void | adjust_expr_shifts (exprt &expr) |
| void | adjust_expr_unary_boolean (exprt &expr) |
| void | adjust_expr_binary_boolean (exprt &expr) |
| virtual void | adjust_expr_rel (exprt &expr) |
| void | adjust_float_arith (exprt &expr) |
| void | adjust_index (index_exprt &index) |
| void | adjust_dereference (exprt &deref) |
| void | adjust_address_of (exprt &expr) |
| void | adjust_sizeof (exprt &expr) |
| virtual void | adjust_side_effect (side_effect_exprt &expr) |
| void | adjust_symbol (exprt &expr) |
| void | adjust_comma (exprt &expr) |
| void | adjust_builtin_va_arg (exprt &expr) |
| virtual void | adjust_function_call_arguments (side_effect_expr_function_callt &expr) |
| void | do_special_functions (side_effect_expr_function_callt &expr) |
| void | adjust_operands (exprt &expr) |
| void | adjust_if (exprt &expr) |
| virtual void | adjust_code (codet &code) |
| methods for code (codet) adjustment and other IRs derived from codet | |
| virtual void | adjust_ifthenelse (codet &code) |
| virtual void | adjust_while (codet &code) |
| virtual void | adjust_for (codet &code) |
| virtual void | adjust_switch (codet &code) |
| void | adjust_assign (codet &code) |
| void | adjust_decl (codet &code) |
| virtual void | adjust_decl_block (codet &code) |
| virtual void | align_se_function_call_return_type (exprt &f_op, side_effect_expr_function_callt &expr) |
| ancillary methods to support the expr/code adjustments above | |
| virtual void | adjust_reference (exprt &expr) |
Static Protected Member Functions | |
| static exprt | is_gcc_polymorphic_builtin (const irep_idt &identifier, const exprt::operandst &arguments) |
| static code_blockt | instantiate_gcc_polymorphic_builtin (const irep_idt &identifier, const symbol_exprt &function_symbol, contextt &context) |
Protected Attributes | |
| bool | irep2_owns_arms = false |
| contextt & | context |
| namespacet | ns |
| symbol_generator | tmp_symbol {"clang_c_adjust::"} |
clang C adjuster class for:
|
explicit |
|
virtualdefault |
| bool clang_c_adjust::adjust | ( | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
methods for code (codet) adjustment and other IRs derived from codet
Reimplemented in clang_cpp_adjust.
|
protected |
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protected |
methods for expression (exprt) adjustment and other IRs derived from exprt
|
protected |
|
protected |
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
protected |
if type is not a float then we should check if it is a vector this is needed because a operation such as {0.1, 0.2} + 1 needs to use the float version
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protected |
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protected |
methods for type (typet) adjustment
|
protectedvirtual |
Reimplemented in clang_cpp_adjust.
|
protectedvirtual |
ancillary methods to support the expr/code adjustments above
Reimplemented in clang_cpp_adjust.
|
protected |
|
static |
Declare the concrete instance of the GCC __sync_* / C11 __c11_atomic_* polymorphic builtin that callee and arguments select, adding its parameter symbols and its synthesised body to context on first use.
Returns the symbol to call in place of callee, nil if callee names no such builtin. Static because the IREP2 adjuster calls it too: clang hands these builtins over body-less, so a pass that skips this leaves every atomic load returning nondet (ยง130).
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
Rewrite a binary arithmetic expression over complex operands into the component-level form, in place.
Expects both operands already adjusted; returns false when neither is complex, leaving expr untouched.
A compound assignment over a complex operand has to be expanded here.
goto_convert's remove_assignment rebuilds a op b long after adjustment, so the component-level lowering would never see it and the SMT layer would be handed a raw complex operator (#6713). An lvalue with its own side effect is left alone: expanding it would evaluate that effect twice, and a loud failure downstream beats a wrong answer.
|
inline |
Hand the index rewrite to the IREP2 adjuster.
Set only by the C driver: clang_cpp_adjust derives from this class, and the IREP2 pass is wired into clang_c_languaget::typecheck alone, so a global option check here would disable the rewrite for C++ with nothing to replace it.
|
protected |
True when a name-matched builtin lowering would discard a definition the program supplies, in which case the definition wins.
True when lowering this call would throw away a definition the program supplies.
See #6904.
Libc's own declarations are bodiless and the <cmath> overloads forward to their __builtin_ spelling, so both still lower.
|
protected |
|
protected |
|
protected |