Go to the documentation of this file.
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);
91 else if(type.
id()==ID_template)
95 else if(type.
id()==ID_frontend_pointer)
102 tmp.
set(ID_C_reference,
true);
103 if(type.
get_bool(ID_C_rvalue_reference))
104 tmp.
set(ID_C_rvalue_reference,
true);
105 const irep_idt typedef_identifier = type.
get(ID_C_typedef);
106 if(!typedef_identifier.
empty())
107 tmp.
set(ID_C_typedef, typedef_identifier);
108 other.push_back(tmp);
110 else if(type.
id()==ID_pointer)
113 other.push_back(type);
115 else if(type.
id() == ID_frontend_vector)
125 other.push_back(type);
131 irept &arguments=t.
add(ID_arguments);
133 for(
auto &argument : arguments.
get_sub())
138 bool is_type=decl.
get_bool(ID_is_type);
154 other.push_back(type);
155 other.back().id(ID_code);
172 if(!parameters.empty() && parameters.back().id() == ID_ellipsis)
175 parameters.pop_back();
178 for(
auto ¶meter_expr : parameters)
180 if(parameter_expr.id()==ID_cpp_declaration)
197 parameter_expr.add_source_location()=type_location;
205 if(final_type.
id()==ID_array)
220 assert(!base_name.
empty());
227 throw "expected simple name as parameter";
233 parameter_expr.swap(new_parameter);
236 else if(parameter_expr.id()==ID_ellipsis)
238 throw "ellipsis only allowed as last parameter";
245 if(parameters.size() == 1 && parameters.front().type().id() == ID_empty)
256 error() <<
"illegal type modifier for defined type" <<
eom;
270 throw "illegal type modifier for C++ bool";
285 throw "illegal type modifier for wchar_t";
300 throw "illegal type modifier for char16_t";
315 throw "illegal type modifier for char32_t";
331 type.
id() == ID_cpp_name || type.
id() == ID_struct ||
332 type.
id() == ID_union || type.
id() == ID_array || type.
id() == ID_code ||
333 type.
id() == ID_unsignedbv || type.
id() == ID_signedbv ||
334 type.
id() == ID_bool || type.
id() == ID_floatbv || type.
id() == ID_empty ||
335 type.
id() == ID_constructor || type.
id() == ID_destructor ||
336 type.
id() == ID_c_enum)
339 else if(type.
id() == ID_c_bool)
346 cpp_convert_type.
write(type);
363 for(
auto &t : cpp_convert_type.
other)
364 if(t.id() == ID_auto)
367 cpp_convert_type.
write(dest);
#define UNREACHABLE
This should be used to mark dead code.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
std::size_t char32_t_count
virtual void set_attributes(typet &type) const
Add qualifiers and GCC attributes onto type.
The type of an expression, extends irept.
std::vector< parametert > parameterst
unsignedbv_typet char32_t_type()
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
cpp_declarationt & to_cpp_declaration(irept &irep)
const irept & find(const irep_idt &name) const
virtual void write(typet &type)
source_locationt source_location
void set_identifier(const irep_idt &identifier)
c_qualifierst c_qualifiers
const type_with_subtypet & to_type_with_subtype(const typet &type)
Base class for all expressions.
unsigned gcc_float64x_cnt
struct configt::ansi_ct ansi_c
unsignedbv_typet char16_t_type()
void read_function_type(const typet &type)
void write(typet &type) override
const declaratorst & declarators() const
const irep_idt & get(const irep_idt &name) const
typet & type()
Return the type of the expression.
void read_rec(const typet &type) override
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
source_locationt source_location
const exprt & default_value() const
void set(const irep_idt &name, const irep_idt &value)
const source_locationt & source_location() const
bool is_simple_name() const
bitvector_typet wchar_t_type()
pointer_typet pointer_type(const typet &subtype)
const irep_idt & id() const
const parameterst & parameters() const
cpp_convert_typet(message_handlert &message_handler, const typet &type)
source_locationt & add_source_location()
void set_base_name(const irep_idt &name)
void cpp_convert_plain_type(typet &type, message_handlert &message_handler)
std::size_t char16_t_count
message_handlert & get_message_handler()
message_handlert * message_handler
irept & add(const irep_idt &name)
const source_locationt & source_location() const
virtual void build_type_with_subtype(typet &type) const
Build a vector or complex type with type as subtype.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
void cpp_convert_auto(typet &dest, const typet &src, message_handlert &message_handler)
const typet & return_type() const
virtual void read(const typet &type)
There are a large number of kinds of tree structured or tree-like data in CPROVER.
std::size_t pointer_width
source_locationt & add_source_location()
The pointer type These are both 'bitvector_typet' (they have a width) and 'type_with_subtypet' (they ...
irep_idt get_base_name() const
virtual void read_rec(const typet &type)
bool get_bool(const irep_idt &name) const
const typet & element_type() const
The type of the elements of the array.
void read_template(const typet &type)
typet merge_type(const typet &declaration_type) const
std::size_t wchar_t_count