25 std::ostringstream error_message;
26 error_message << identifier <<
" takes exactly 2 arguments, but "
27 << expr.
arguments().size() <<
" were provided";
37 std::ostringstream error_message;
38 error_message << identifier
39 <<
" argument 1 must be string constant (literal), but ("
40 <<
expr2c(arg1, ns) <<
") has type `"
41 <<
type2c(arg1.type(), ns) <<
'`';
49 const auto &arg2_type = arg2.type();
50 const auto arg2_type_as_bv =
51 type_try_dynamic_cast<bitvector_typet>(arg2_type);
59 std::ostringstream error_message;
60 error_message << identifier
61 <<
" argument 2 must be a byte-sized integer, but ("
62 <<
expr2c(arg2, ns) <<
") has type `" <<
type2c(arg2_type, ns)
90 std::ostringstream error_message;
91 error_message << identifier <<
" takes exactly 2 arguments, but "
92 << expr.
arguments().size() <<
" were provided";
98 const auto arg1_type_as_ptr =
99 type_try_dynamic_cast<pointer_typet>(arg1.type());
101 !arg1_type_as_ptr || !arg1_type_as_ptr->has_subtype() ||
106 std::ostringstream error_message;
107 error_message << identifier
108 <<
" argument 1 must be a non-void pointer, but ("
109 <<
expr2c(arg1, ns) <<
") has type `"
110 <<
type2c(arg1.type(), ns)
111 <<
"`. Insert a cast to the type that you want to access.";
121 std::ostringstream error_message;
122 error_message << identifier
123 <<
" argument 2 must be string constant (literal), but ("
124 <<
expr2c(arg2, ns) <<
") has type `"
125 <<
type2c(arg2.type(), ns) <<
'`';
155 std::ostringstream error_message;
156 error_message << identifier <<
" takes exactly 3 arguments, but "
157 << expr.
arguments().size() <<
" were provided";
163 const auto arg1_type_as_ptr =
164 type_try_dynamic_cast<pointer_typet>(arg1.type());
166 !arg1_type_as_ptr || !arg1_type_as_ptr->has_subtype() ||
171 std::ostringstream error_message;
172 error_message << identifier
173 <<
" argument 1 must be a non-void pointer, but ("
174 <<
expr2c(arg1, ns) <<
") has type `"
175 <<
type2c(arg1.type(), ns)
176 <<
"`. Insert a cast to the type that you want to access.";
186 std::ostringstream error_message;
187 error_message << identifier
188 <<
" argument 2 must be string constant (literal), but ("
189 <<
expr2c(arg2, ns) <<
") has type `"
190 <<
type2c(arg2.type(), ns) <<
'`';
197 const auto &arg3_type = arg3.type();
204 std::ostringstream error_message;
205 error_message << identifier
206 <<
" argument 3 must be a boolean or of integer value, but ("
207 <<
expr2c(arg3, ns) <<
") has type `" <<
type2c(arg3_type, ns)
232 "expr.function() has to be a symbol_expr");
ANSI-C Language Type Checking.
static symbol_exprt typecheck_get_field(const side_effect_expr_function_callt &expr, const irep_idt &identifier, const namespacet &ns)
Function to typecheck a shadow memory get_field function.
static symbol_exprt typecheck_set_field(const side_effect_expr_function_callt &expr, const irep_idt &identifier, const namespacet &ns)
Function to typecheck a shadow memory set_field function.
static symbol_exprt typecheck_field_decl(const side_effect_expr_function_callt &expr, const irep_idt &identifier, const namespacet &ns)
Function to typecheck a shadow memory field_declaration function.
signedbv_typet signed_int_type()
virtual std::optional< symbol_exprt > typecheck_shadow_memory_builtin(const side_effect_expr_function_callt &expr)
Typecheck the function if it is a shadow_memory builtin and return a symbol for it.
struct configt::ansi_ct ansi_c
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
source_locationt & add_source_location()
const source_locationt & source_location() const
Thrown when we can't handle something in an input source file.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
A side_effect_exprt representation of a function call side effect.
exprt::operandst & arguments()
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
const typet & subtype() const
std::string expr2c(const exprt &expr, const namespacet &ns, const expr2c_configurationt &configuration)
std::string type2c(const typet &type, const namespacet &ns, const expr2c_configurationt &configuration)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
bool can_cast_expr< symbol_exprt >(const exprt &base)
bool can_cast_type< bool_typet >(const typet &base)
bool can_cast_type< bitvector_typet >(const typet &type)
Check whether a reference to a typet is a bitvector_typet.
bool can_cast_expr< string_constantt >(const exprt &base)
const type_with_subtypet & to_type_with_subtype(const typet &type)