Go to the documentation of this file.
62 std::cout <<
"cpp_convert_typet::read_rec: "
66 if(type.
id() == ID_gcc_float80)
68 else if(type.
id()==ID_wchar_t)
70 else if(type.
id()==ID_char16_t)
72 else if(type.
id()==ID_char32_t)
74 else if(type.
id()==ID_constexpr)
76 else if(type.
id()==ID_function_type)
80 else if(type.
id()==ID_identifier)
84 else if(type.
id()==ID_cpp_name)
87 other.push_back(type);
89 else if(type.
id()==ID_array)
91 other.push_back(type);
94 else if(type.
id()==ID_template)
98 else if(type.
id()==ID_frontend_pointer)
104 tmp.
set(ID_C_reference,
true);
105 if(type.
get_bool(ID_C_rvalue_reference))
106 tmp.
set(ID_C_rvalue_reference,
true);
107 const irep_idt typedef_identifier = type.
get(ID_C_typedef);
108 if(!typedef_identifier.
empty())
109 tmp.
set(ID_C_typedef, typedef_identifier);
110 other.push_back(tmp);
112 else if(type.
id()==ID_pointer)
115 other.push_back(type);
117 else if(type.
id() == ID_frontend_vector)
127 other.push_back(type);
132 irept &arguments=t.
add(ID_arguments);
139 bool is_type=decl.
get_bool(ID_is_type);
155 other.push_back(type);
156 other.back().id(ID_code);
173 if(!parameters.empty() && parameters.back().id() == ID_ellipsis)
176 parameters.pop_back();
179 for(
auto ¶meter_expr : parameters)
181 if(parameter_expr.id()==ID_cpp_declaration)
198 parameter_expr.add_source_location()=type_location;
206 if(final_type.
id()==ID_array)
221 assert(!base_name.
empty());
228 throw "expected simple name as parameter";
234 parameter_expr.swap(new_parameter);
237 else if(parameter_expr.id()==ID_ellipsis)
239 throw "ellipsis only allowed as last parameter";
246 if(parameters.size() == 1 && parameters.front().type().id() == ID_empty)
257 error() <<
"illegal type modifier for defined type" <<
eom;
271 throw "illegal type modifier for C++ bool";
286 throw "illegal type modifier for wchar_t";
301 throw "illegal type modifier for char16_t";
316 throw "illegal type modifier for char32_t";
332 type.
id() == ID_cpp_name || type.
id() == ID_struct ||
333 type.
id() == ID_union || type.
id() == ID_array || type.
id() == ID_code ||
334 type.
id() == ID_unsignedbv || type.
id() == ID_signedbv ||
335 type.
id() == ID_bool || type.
id() == ID_floatbv || type.
id() == ID_empty ||
336 type.
id() == ID_constructor || type.
id() == ID_destructor)
339 else if(type.
id()==ID_c_enum)
345 else if(type.
id() == ID_c_bool)
352 cpp_convert_type.
write(type);
368 for(
auto &t : cpp_convert_type.
other)
369 if(t.id() == ID_auto)
372 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
const typet & subtype() const
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)
ANSI-C Language Conversion.
virtual void write(typet &type)
source_locationt source_location
void set_identifier(const irep_idt &identifier)
irept & add(const irep_namet &name)
c_qualifierst c_qualifiers
const irept & find(const irep_namet &name) const
C++ Language Type Checking.
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)
#define Forall_irep(it, irep)
void write(typet &type) override
const declaratorst & declarators() const
typet & type()
Return the type of the expression.
bool get_bool(const irep_namet &name) const
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
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
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 irep_idt & get(const irep_namet &name) const
void set(const irep_namet &name, const irep_idt &value)
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)
void read_template(const typet &type)
typet merge_type(const typet &declaration_type) const
std::size_t wchar_t_count