58 std::cout <<
"cpp_convert_typet::read_rec: "
62 if(type.
id() == ID_gcc_float80)
64 else if(type.
id()==ID_wchar_t)
66 else if(type.
id()==ID_char16_t)
68 else if(type.
id()==ID_char32_t)
70 else if(type.
id()==ID_constexpr)
72 else if(type.
id()==ID_function_type)
76 else if(type.
id()==ID_identifier)
80 else if(type.
id()==ID_cpp_name)
83 other.push_back(type);
85 else if(type.
id()==ID_array)
87 other.push_back(type);
90 else if(type.
id()==ID_template)
94 else if(type.
id()==ID_frontend_pointer)
101 tmp.
set(ID_C_reference,
true);
102 if(type.
get_bool(ID_C_rvalue_reference))
103 tmp.
set(ID_C_rvalue_reference,
true);
104 const irep_idt typedef_identifier = type.
get(ID_C_typedef);
105 if(!typedef_identifier.
empty())
106 tmp.
set(ID_C_typedef, typedef_identifier);
107 other.push_back(tmp);
109 else if(type.
id()==ID_pointer)
112 other.push_back(type);
114 else if(type.
id() == ID_frontend_vector)
124 other.push_back(type);
129 irept &arguments=t.
add(ID_arguments);
131 for(
auto &argument : arguments.
get_sub())
136 bool is_type=decl.
get_bool(ID_is_type);
152 other.push_back(type);
153 other.back().id(ID_code);
170 if(!parameters.empty() && parameters.back().id() == ID_ellipsis)
173 parameters.pop_back();
176 for(
auto ¶meter_expr : parameters)
178 if(parameter_expr.id()==ID_cpp_declaration)
195 parameter_expr.add_source_location()=type_location;
203 if(final_type.
id()==ID_array)
218 assert(!base_name.
empty());
225 throw "expected simple name as parameter";
231 parameter_expr.swap(new_parameter);
234 else if(parameter_expr.id()==ID_ellipsis)
236 throw "ellipsis only allowed as last parameter";
243 if(parameters.size() == 1 && parameters.front().type().id() == ID_empty)
254 error() <<
"illegal type modifier for defined type" <<
eom;
268 throw "illegal type modifier for C++ bool";
283 throw "illegal type modifier for wchar_t";
298 throw "illegal type modifier for char16_t";
313 throw "illegal type modifier for char32_t";
329 type.
id() == ID_cpp_name || type.
id() == ID_struct ||
330 type.
id() == ID_union || type.
id() == ID_array || type.
id() == ID_code ||
331 type.
id() == ID_unsignedbv || type.
id() == ID_signedbv ||
332 type.
id() == ID_bool || type.
id() == ID_floatbv || type.
id() == ID_empty ||
333 type.
id() == ID_constructor || type.
id() == ID_destructor)
336 else if(type.
id()==ID_c_enum)
342 else if(type.
id() == ID_c_bool)
349 cpp_convert_type.
write(type);
365 for(
auto &t : cpp_convert_type.
other)
366 if(t.id() == ID_auto)
369 cpp_convert_type.
write(dest);
ANSI-C Language Conversion.
unsignedbv_typet char32_t_type()
pointer_typet pointer_type(const typet &subtype)
bitvector_typet wchar_t_type()
unsignedbv_typet char16_t_type()
virtual void read_rec(const typet &type)
virtual void read(const typet &type)
virtual void write(typet &type)
virtual void set_attributes(typet &type) const
Add qualifiers and GCC attributes onto type.
unsigned gcc_float64x_cnt
source_locationt source_location
virtual void build_type_with_subtype(typet &type) const
Build a vector or complex type with type as subtype.
c_qualifierst c_qualifiers
const exprt & default_value() const
void set_base_name(const irep_idt &name)
void set_identifier(const irep_idt &identifier)
std::vector< parametert > parameterst
const parameterst & parameters() const
const typet & return_type() const
struct configt::ansi_ct ansi_c
std::size_t char32_t_count
void write(typet &type) override
cpp_convert_typet(message_handlert &message_handler, const typet &type)
std::size_t char16_t_count
void read_rec(const typet &type) override
std::size_t wchar_t_count
void read_template(const typet &type)
void read_function_type(const typet &type)
const declaratorst & declarators() const
typet merge_type(const typet &declaration_type) const
irep_idt get_base_name() const
bool is_simple_name() const
const source_locationt & source_location() const
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
source_locationt & add_source_location()
There are a large number of kinds of tree structured or tree-like data in CPROVER.
bool get_bool(const irep_idt &name) const
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
const irept & find(const irep_idt &name) const
const irep_idt & get(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
irept & add(const irep_idt &name)
source_locationt source_location
message_handlert * message_handler
message_handlert & get_message_handler()
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
The type of an expression, extends irept.
const typet & subtype() const
source_locationt & add_source_location()
const source_locationt & source_location() const
void cpp_convert_auto(typet &dest, const typet &src, message_handlert &message_handler)
void cpp_convert_plain_type(typet &type, message_handlert &message_handler)
C++ Language Type Checking.
cpp_declarationt & to_cpp_declaration(irept &irep)
#define UNREACHABLE
This should be used to mark dead code.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
std::size_t pointer_width
const type_with_subtypet & to_type_with_subtype(const typet &type)