38 original_scope(nullptr)
47 for(
const auto &id_ptr : id_set)
49 const cpp_idt &identifier = *id_ptr;
56 identifiers.push_back(e);
67 old_identifiers.swap(identifiers);
69 for(
const auto &old_id : old_identifiers)
78 identifiers.push_back(e);
89 old_identifiers.swap(identifiers);
91 for(
const auto &old_id : old_identifiers)
98 identifiers.push_back(e);
105 if(identifiers.size()==1)
108 exprt e=*identifiers.begin();
111 const symbolt &template_symbol=
127 identifiers.push_back(
136 old_identifiers.swap(identifiers);
138 for(
const auto &old_id : old_identifiers)
140 const typet &followed =
141 old_id.type().
id() == ID_struct_tag
142 ?
static_cast<const typet &
>(
144 : old_id.type().
id() == ID_union_tag
145 ?
static_cast<const typet &
>(
147 : old_id.type().id() == ID_c_enum_tag
148 ?
static_cast<const typet &
>(
151 if(!followed.
get_bool(ID_is_template))
152 identifiers.push_back(old_id);
160 old_identifiers.swap(identifiers);
162 std::set<irep_idt> ids;
163 std::set<exprt> other;
165 for(
const auto &old_id : old_identifiers)
169 if(old_id.id() == ID_symbol)
171 else if(old_id.id() == ID_type && old_id.type().id() == ID_struct_tag)
173 else if(old_id.id() == ID_type && old_id.type().id() == ID_union_tag)
178 if(other.insert(old_id).second)
179 identifiers.push_back(old_id);
183 if(ids.insert(
id).second)
184 identifiers.push_back(old_id);
193 std::cout <<
"RESOLVE MAP:\n";
205 <<
"without instance:\n"
230 const symbolt &compound_symbol=
234 compound_symbol.
type.
id() == ID_struct ||
235 compound_symbol.
type.
id() == ID_union);
265 this_class_identifier <<
'\n';
268 const exprt &this_expr=
281 this_expr.
type().
id() == ID_pointer,
282 "this argument should be pointer");
285 object.copy_to_operands(this_expr);
291 object.set(ID_C_lvalue,
true);
297 (
object.type().
id() != ID_struct_tag &&
298 object.type().
id() != ID_union_tag) ||
305 if(
object.is_not_nil())
324 compound_symbol.
type.
id() == ID_struct ? ID_struct_tag
347 else if(symbol.
type.
id()==ID_c_enum)
351 else if(symbol.
type.
id() == ID_struct)
355 else if(symbol.
type.
id() == ID_union)
392 old_identifiers.swap(identifiers);
394 for(
const auto &old_id : old_identifiers)
401 match = (old_id.id() == ID_type);
405 match = (old_id.id() != ID_type);
417 identifiers.push_back(old_id);
429 old_identifiers.swap(identifiers);
434 for(
const auto &old_id : old_identifiers)
439 identifiers.push_back(old_id);
448 old_identifiers.swap(identifiers);
451 std::multimap<std::size_t, exprt> distance_map;
453 for(
const auto &old_id : old_identifiers)
455 unsigned args_distance;
459 std::size_t template_distance=0;
461 if(!old_id.type().get(ID_C_template).empty())
462 template_distance = old_id.type()
463 .find(ID_C_template_arguments)
470 std::size_t total_distance=
472 1000*template_distance+args_distance;
474 distance_map.insert({total_distance, old_id});
478 old_identifiers.clear();
481 if(!distance_map.empty())
483 auto range = distance_map.equal_range(distance_map.begin()->first);
484 for(
auto it = range.first; it != range.second; ++it)
485 old_identifiers.push_back(it->second);
488 if(old_identifiers.size() > 1 && fargs.
in_use)
492 for(resolve_identifierst::const_iterator old_it = old_identifiers.begin();
493 old_it != old_identifiers.end();
497 std::cout <<
"I1: " << old_it->get(ID_identifier) <<
'\n';
500 if(old_it->type().id() != ID_code)
502 identifiers.push_back(*old_it);
508 for(resolve_identifierst::const_iterator resolve_it = old_it + 1;
509 resolve_it != old_identifiers.end();
512 if(resolve_it->type().id() != ID_code)
520 "parameter numbers should match");
526 i<f1.
parameters().size() && (f1_better || f2_better);
538 if(type1.
id()==ID_pointer)
544 if(type2.
id()==ID_pointer)
550 if(type1.
id() != ID_struct_tag || type2.
id() != ID_struct_tag)
569 if(!f1_better || f2_better)
570 identifiers.push_back(*resolve_it);
576 identifiers.
swap(old_identifiers);
587 for(
const auto &identifier : identifiers)
589 if(identifier.id() != ID_type)
592 new_identifiers.push_back(identifier);
605 exprt pod_constructor1(ID_pod_constructor, t1);
606 new_identifiers.push_back(pod_constructor1);
613 exprt pod_constructor2(ID_pod_constructor, t2);
614 new_identifiers.push_back(pod_constructor2);
618 if(identifier.type().id() == ID_c_enum_tag)
622 exprt pod_constructor3(ID_pod_constructor, t3);
623 new_identifiers.push_back(pod_constructor3);
626 else if(identifier.type().id() == ID_struct_tag)
640 type.
id() == ID_code &&
641 to_code_type(type).return_type().
id() == ID_constructor)
647 new_identifiers.push_back(e);
653 identifiers.
swap(new_identifiers);
660 if(argument.
id() == ID_ambiguous)
680 if(base_name==ID_unsignedbv ||
681 base_name==ID_signedbv)
683 if(arguments.size()!=1)
687 << base_name <<
" expects one template argument, but got "
692 exprt argument=arguments.front();
694 if(argument.
id()==ID_type)
698 << base_name <<
" expects one integer template argument, "
705 const auto i = numeric_cast<mp_integer>(argument);
718 <<
"template argument must be greater than zero"
726 else if(base_name==ID_fixedbv)
728 if(arguments.size()!=2)
732 << base_name <<
" expects two template arguments, but got "
737 exprt argument0=arguments[0];
739 exprt argument1=arguments[1];
742 if(argument0.
id()==ID_type)
746 << base_name <<
" expects two integer template arguments, "
751 if(argument1.
id()==ID_type)
755 << base_name <<
" expects two integer template arguments, "
760 const auto width = numeric_cast<mp_integer>(argument0);
762 if(!width.has_value())
770 const auto integer_bits = numeric_cast<mp_integer>(argument1);
772 if(!integer_bits.has_value())
784 <<
"template argument must be greater than zero"
789 if(*integer_bits < 0)
793 <<
"template argument must be greater or equal zero"
798 if(*integer_bits > *width)
802 <<
"template argument must be smaller or equal width"
811 else if(base_name==ID_integer)
813 if(!arguments.empty())
817 << base_name <<
" expects no template arguments"
824 else if(base_name.
starts_with(
"constant_infinity"))
829 else if(base_name==
"dump_scopes")
837 else if(base_name==
"current_scope")
844 else if(base_name == ID_size_t)
848 else if(base_name == ID_ssize_t)
876 irept::subt::const_iterator
pos=cpp_name.
get_sub().begin();
888 std::string final_base_name;
893 if(
pos->id()==ID_name)
894 final_base_name+=
pos->get_string(ID_identifier);
895 else if(
pos->id()==ID_template_args)
897 else if(
pos->id()==
"::")
911 std::cout <<
"X: " << id_set.size() <<
'\n';
939 <<
"scope '" << final_base_name <<
"' not found" <<
messaget::eom;
942 else if(id_set.size()>=2)
965 final_base_name.clear();
967 else if(
pos->id()==ID_operator)
969 final_base_name+=
"operator";
971 irept::subt::const_iterator next=
pos+1;
975 next->id() == ID_cpp_name || next->id() == ID_pointer ||
976 next->id() == ID_int || next->id() == ID_char ||
977 next->id() == ID_c_bool || next->id() == ID_merged_type)
982 op_name.
swap(next_ir);
989 final_base_name+=
pos->id_string();
994 base_name=final_base_name;
1014 std::set<irep_idt> primary_templates;
1016 for(
const auto &id_ptr : id_set)
1018 const irep_idt id = id_ptr->identifier;
1026 if(!specialization_of.
empty())
1027 primary_templates.insert(specialization_of);
1029 primary_templates.insert(
id);
1034 if(primary_templates.size()>=2)
1043 const symbolt &primary_template_symbol=
1056 full_template_args_tc=
1059 primary_template_symbol,
1060 full_template_args);
1062 for(
auto &arg : full_template_args_tc.
arguments())
1064 if(arg.id() == ID_type)
1066 if(arg.id() == ID_symbol)
1086 std::vector<matcht> matches;
1090 matcht(full_template_args_tc, full_template_args_tc,
1091 primary_template_symbol.
name));
1093 for(
const auto &id_ptr : id_set)
1095 const irep_idt id = id_ptr->identifier;
1117 full_template_args_tc.
arguments().size() ==
1118 partial_specialization_args.
arguments().size(),
1119 "number of arguments should match");
1127 if(template_scope==
nullptr)
1131 <<
"class template instantiation error"
1139 for(std::size_t i=0; i<full_template_args_tc.
arguments().size(); i++)
1141 if(full_template_args_tc.
arguments()[i].id()==ID_type)
1143 full_template_args_tc.
arguments()[i].type());
1162 primary_template_symbol,
1163 partial_specialization_args);
1168 partial_specialization_args_tc.
arguments().size() ==
1169 full_template_args_tc.
arguments().size(),
1170 "argument numbers must match");
1172 if(partial_specialization_args_tc==
1173 full_template_args_tc)
1175 matches.push_back(
matcht(
1176 guessed_template_args, full_template_args_tc,
id));
1183 std::sort(matches.begin(), matches.end());
1186 for(std::vector<matcht>::const_iterator
1187 m_it=matches.begin();
1188 m_it!=matches.end();
1191 std::cout <<
"M: " << m_it->cost
1192 <<
" " << m_it->id <<
'\n';
1198 const matcht &match=*matches.begin();
1212 if(instance.
type.
id()!=ID_struct)
1265 else if(id_set.size()==1)
1284 for(
const auto &id_expr : identifiers)
1288 if(id_expr.id()==ID_type)
1296 if(id_expr.type().get_bool(ID_is_template))
1299 if(id_expr.id()==ID_member)
1304 else if(id_expr.id() == ID_pod_constructor)
1306 out <<
"constructor ";
1309 else if(id_expr.id()==ID_template_function_instance)
1319 if(id_expr.type().get_bool(ID_is_template))
1322 else if(id_expr.type().id()==ID_code)
1328 out <<
" " <<
id <<
"(";
1332 for(
const auto ¶meter : parameters)
1334 const typet ¶meter_type = parameter.type();
1346 if(!parameters.empty())
1356 if(id_expr.id()==ID_symbol)
1359 out <<
" (" << symbol.
location <<
")";
1361 else if(id_expr.id()==ID_template_function_instance)
1365 out <<
" (" << symbol.
location <<
")";
1377 bool fail_with_exception)
1390 std::cout <<
"base name: " << base_name <<
'\n';
1391 std::cout <<
"template args: " << template_args.
pretty() <<
'\n';
1403 return do_builtin(base_name, fargs, template_args);
1407 if(base_name==
"__func__" ||
1408 base_name==
"__FUNCTION__" ||
1409 base_name==
"__PRETTY_FUNCTION__")
1415 return std::move(s);
1424 if(template_args.
is_nil())
1436 id_set.insert(&builtin_id);
1452 if(!fail_with_exception)
1486 bool have_classes=
false, have_methods=
false;
1488 for(
const auto &id_ptr : id_set)
1490 const irep_idt id = id_ptr->identifier;
1499 if(want==
wantt::BOTH && have_classes && have_methods)
1501 if(!fail_with_exception)
1518 identifiers.push_back(
exprt(ID_type, instance));
1524 id_set, fargs, identifiers);
1527 identifiers, template_args, fargs);
1533 id_set, fargs, identifiers);
1540 filter(identifiers, want);
1543 std::cout <<
"P0 " << base_name <<
" " << identifiers.
size() <<
'\n';
1556 std::cout <<
"P1 " << base_name <<
" " << new_identifiers.
size() <<
'\n';
1565 std::cout <<
"P2 " << base_name <<
" " << new_identifiers.
size() <<
'\n';
1571 if(new_identifiers.empty())
1573 new_identifiers=identifiers;
1575 if(template_args.
is_nil())
1579 if(new_identifiers.empty())
1580 new_identifiers=identifiers;
1586 std::cout <<
"P3 " << base_name <<
" " << new_identifiers.
size() <<
'\n';
1595 std::cout <<
"P4 " << base_name <<
" " << new_identifiers.
size() <<
'\n';
1600 if(new_identifiers.size()==1)
1602 result=*new_identifiers.begin();
1607 if(!fail_with_exception)
1610 if(new_identifiers.empty())
1614 <<
"found no match for symbol '" << base_name <<
"', candidates are:\n";
1621 <<
"symbol '" << base_name <<
"' does not uniquely resolve:\n";
1625 exprt e1=*new_identifiers.begin();
1626 exprt e2=*(++new_identifiers.begin());
1629 <<
"e1.type==e2.type: " << (e1.
type() == e2.
type()) <<
'\n';
1631 <<
"e1.id()==e2.id(): " << (e1.
id() == e2.
id()) <<
'\n';
1633 <<
"e1.iden==e2.iden: "
1634 << (e1.
get(ID_identifier) == e2.
get(ID_identifier)) <<
'\n';
1644 for(
const auto &op : fargs.
operands)
1661 if(result.
get_bool(ID_C_not_accessible))
1664 if(!fail_with_exception)
1679 if(!fail_with_exception)
1685 <<
"expected expression, but got type '"
1693 if(result.
id()!=ID_type)
1695 if(!fail_with_exception)
1701 <<
"expected type, but got expression '"
1716 const exprt &template_expr,
1717 const exprt &desired_expr)
1719 if(template_expr.
id()==ID_cpp_name)
1736 for(
const auto &id_ptr : id_set)
1744 if(e.
id()==ID_unassigned)
1756 const typet &template_type,
1757 const typet &desired_type)
1790 std::cout <<
"TT: " << template_type.
pretty() <<
'\n';
1791 std::cout <<
"DT: " << desired_type.
pretty() <<
'\n';
1794 if(template_type.
id()==ID_cpp_name)
1821 for(
const auto &id_ptr : id_set)
1830 if(t.
id()==ID_unassigned)
1838 std::cout <<
"ASSIGN " <<
id.identifier <<
" := "
1847 else if(template_type.
id()==ID_merged_type)
1861 else if(template_type.
id()==ID_pointer)
1863 if(desired_type.
id() == ID_pointer)
1868 else if(template_type.
id()==ID_array)
1870 if(desired_type.
id() == ID_array)
1891 expr.
type().
id() == ID_struct_tag
1892 ?
static_cast<const typet &
>(
1894 : expr.
type().
id() == ID_union_tag
1895 ?
static_cast<const typet &
>(
1897 : expr.
type().
id() == ID_c_enum_tag
1898 ?
static_cast<const typet &
>(
1925 const symbolt &template_symbol=
1942 if(function_declarator.
type().
id()!=ID_function_type)
1946 <<
"expected function type for function template"
1958 if(template_scope==
nullptr)
1962 << template_identifier <<
'\n'
1963 <<
"function template instantiation error"
1975 exprt::operandst::const_iterator it=fargs.
operands.begin();
1976 for(
const auto ¶meter : parameters)
1981 if(parameter.id()==ID_cpp_declaration)
1988 arg_declaration.
declarators().size() == 1,
"exactly one declarator");
1993 merge_type(arg_declaration.
type());
2017 typet function_type=
2024 function_type.
set(ID_C_template, template_symbol.
name);
2025 function_type.
set(ID_C_template_arguments, template_args);
2029 exprt template_function_instance(
2030 ID_template_function_instance, function_type);
2032 return template_function_instance;
2040 if(expr.
id()!=ID_symbol)
2043 const symbolt &template_symbol =
2050 if(template_args_non_tc.
is_nil())
2071 template_args_non_tc);
2118 fargs.
operands.begin()->type().get(ID_identifier));
2126 "method should exist in struct");
2145 unsigned &args_distance,
2155 if(expr.
id()==ID_member ||
2170 const typet &object_type =
2173 object.set(ID_C_lvalue,
true);
2183 fargs.
operands.size() == parameters.size())
2215 for(
const auto &id_ptr : id_set)
2219 if(
id.is_class() ||
id.is_enum() ||
id.is_namespace())
2223 new_set.insert(&
id);
2225 else if(
id.is_typedef())
2239 if(symbol.
type.
id()==ID_struct)
2246 new_set.insert(&class_id);
2261 if(symbol.
type.
id() == ID_struct)
2263 id.print(std::cout);
2264 assert(
id.is_scope);
2265 new_set.insert(&
id);
2284 std::cout <<
"E: " << e.
pretty() <<
'\n';
2290 if(e.
type().
id() == ID_template_parameter_symbol_type)
2296 irep_idt identifier=type.get_identifier();
2301 if(symbol.
type.
id() == ID_template_parameter_symbol_type)
2303 else if(symbol.
type.
id()==ID_struct ||
2304 symbol.
type.
id()==ID_union ||
2305 symbol.
type.
id()==ID_c_enum)
2312 new_set.insert(&class_id);
2322 id_set.swap(new_set);
2329 for(cpp_scopest::id_sett::iterator
2334 if((*it)->is_namespace())
2338 cpp_scopest::id_sett::iterator old(it);
2351 for(
const auto &arg : fargs.
operands)
2353 if(arg.type().id() != ID_struct_tag && arg.type().id() != ID_union_tag)
2357 arg.type().
id() == ID_struct_tag
2366 id_set.insert(tmp_set.begin(), tmp_set.end());
bool has_component_rec(const typet &type, const irep_idt &component_name, const namespacet &ns)
C Language Type Checking.
signedbv_typet signed_int_type()
pointer_typet pointer_type(const typet &subtype)
signedbv_typet signed_size_type()
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
const c_enum_tag_typet & to_c_enum_tag_type(const typet &type)
Cast a typet to a c_enum_tag_typet.
C enum tag type, i.e., c_enum_typet with an identifier.
std::vector< parametert > parameterst
const typet & return_type() const
bool has_ellipsis() const
const parameterst & parameters() const
const declaratorst & declarators() const
irep_idt get_specialization_of() const
bool is_class_template() const
template_typet & template_type()
cpp_template_args_non_tct & partial_specialization_args()
typet merge_type(const typet &declaration_type) const
void print(std::ostream &out, unsigned indent=0) const
irep_idt class_identifier
bool is_qualified() const
const source_locationt & source_location() const
bool has_template_args() const
cpp_scopet & get_root_scope()
cpp_scopet & current_scope()
cpp_idt & get_id(const irep_idt &identifier)
std::set< cpp_idt * > id_sett
cpp_scopet & get_scope(const irep_idt &identifier)
cpp_scopet & get_parent() const
id_sett lookup(const irep_idt &base_name_to_lookup, lookup_kindt kind)
cpp_idt & insert(const irep_idt &_base_name)
bool is_root_scope() const
exprt::operandst argumentst
bool has_unassigned() const
exprt::operandst operands
bool match(const code_typet &code_type, unsigned &distance, cpp_typecheckt &cpp_typecheck) const
void add_object(const exprt &expr)
void remove_templates(resolve_identifierst &identifiers)
void filter(resolve_identifierst &identifiers, const wantt want)
exprt convert_template_parameter(const cpp_idt &id)
exprt convert_identifier(const cpp_idt &id, const cpp_typecheck_fargst &fargs)
cpp_scopet & resolve_namespace(const cpp_namet &cpp_name)
std::vector< exprt > resolve_identifierst
cpp_typecheck_resolvet(class cpp_typecheckt &_cpp_typecheck)
void remove_duplicates(resolve_identifierst &identifiers)
void filter_for_namespaces(cpp_scopest::id_sett &id_set)
exprt resolve(const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
void resolve_argument(exprt &argument, const cpp_typecheck_fargst &fargs)
exprt do_builtin(const irep_idt &base_name, const cpp_typecheck_fargst &fargs, const cpp_template_args_non_tct &template_args)
void show_identifiers(const irep_idt &base_name, const resolve_identifierst &identifiers, std::ostream &out)
void filter_for_named_scopes(cpp_scopest::id_sett &id_set)
void make_constructors(resolve_identifierst &identifiers)
void guess_function_template_args(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
guess arguments of function templates
void convert_identifiers(const cpp_scopest::id_sett &id_set, const cpp_typecheck_fargst &fargs, resolve_identifierst &identifiers)
source_locationt source_location
void disambiguate_functions(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
void apply_template_args(resolve_identifierst &identifiers, const cpp_template_args_non_tct &template_args, const cpp_typecheck_fargst &fargs)
cpp_scopet * original_scope
void resolve_with_arguments(cpp_scopest::id_sett &id_set, const irep_idt &base_name, const cpp_typecheck_fargst &fargs)
cpp_scopet & resolve_scope(const cpp_namet &cpp_name, irep_idt &base_name, cpp_template_args_non_tct &template_args)
struct_tag_typet disambiguate_template_classes(const irep_idt &base_name, const cpp_scopest::id_sett &id_set, const cpp_template_args_non_tct &template_args)
disambiguate partial specialization
cpp_typecheckt & cpp_typecheck
void exact_match_functions(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
void guess_template_args(const typet &template_parameter, const typet &desired_type)
void typecheck_type(typet &) override
instantiation_stackt instantiation_stack
template_mapt template_map
bool cpp_is_pod(const typet &type) const
void show_instantiation_stack(std::ostream &)
cpp_template_args_tct typecheck_template_args(const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_non_tct &template_args)
void elaborate_class_template(const typet &type)
elaborate class template instances
bool builtin_factory(const irep_idt &) override
bool subtype_typecast(const struct_typet &from, const struct_typet &to) const
std::string to_string(const typet &) override
bool disable_access_control
const symbolt & instantiate_template(const source_locationt &source_location, const symbolt &symbol, const cpp_template_args_tct &specialization_template_args, const cpp_template_args_tct &full_template_args, const typet &specialization=uninitialized_typet{})
const symbolt & class_template_symbol(const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_tct &specialization_template_args, const cpp_template_args_tct &full_template_args)
void typecheck_expr_member(exprt &) override
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
bool starts_with(const char *s) const
equivalent of as_string().starts_with(s)
Base class for all expressions.
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
void copy_to_operands(const exprt &expr)
Copy the given argument to the end of exprt's operands.
source_locationt & add_source_location()
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
bool is_constant() const
Return whether the expression is a constant.
void add_to_operands(const exprt &expr)
Add the given argument to the end of exprt's operands.
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 remove(const irep_idt &name)
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
Extract member of struct or union.
source_locationt source_location
mstreamt & warning() const
message_handlert & get_message_handler()
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const typet & base_type() const
The type of the data what we point to.
const irep_idt & get_function() const
A struct tag type, i.e., struct_typet with an identifier.
Structure type, corresponds to C style structs.
Base type for structs and unions.
const componentt & get_component(const irep_idt &component_name) const
Get the reference to a component with given name.
bool has_component(const irep_idt &component_name) const
const componentst & components() const
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
source_locationt location
Source code location of definition of symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
exprt value
Initial value of symbol.
A tag-based type, i.e., typet with an identifier.
const irep_idt & get_identifier() const
exprt lookup(const irep_idt &identifier) const
void build_unassigned(const template_typet &template_type)
void print(std::ostream &out) const
cpp_template_args_tct build_template_args(const template_typet &template_type) const
An expression denoting a type.
static exprt conditional_cast(const exprt &expr, const typet &type)
The type of an expression, extends irept.
source_locationt & add_source_location()
A union tag type, i.e., union_typet with an identifier.
void cpp_convert_plain_type(typet &type, message_handlert &message_handler)
cpp_declarationt & to_cpp_declaration(irept &irep)
cpp_namet & to_cpp_name(irept &cpp_name)
cpp_template_args_tct & to_cpp_template_args_tc(irept &irep)
cpp_template_args_non_tct & to_cpp_template_args_non_tc(irept &irep)
const template_parameter_symbol_typet & to_template_parameter_symbol_type(const typet &type)
Cast a typet to a template_parameter_symbol_typet.
std::string cpp_type2name(const typet &type)
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_table_baset &symbol_table, const std::string &module, message_handlert &message_handler)
C++ Language Type Checking.
C++ Language Type Checking.
C++ Language Type Checking.
symbol_exprt cpp_symbol_expr(const symbolt &symbol)
const std::string & id2string(const irep_idt &d)
bool is_number(const typet &type)
Returns true if the type is a rational, real, integer, natural, complex, unsignedbv,...
const merged_typet & to_merged_type(const typet &type)
conversion to merged_typet
const std::string integer2string(const mp_integer &n, unsigned base)
bool is_reference(const typet &type)
Returns true if the type is a reference.
bool is_rvalue_reference(const typet &type)
Returns if the type is an R value reference.
const pointer_typet & to_pointer_type(const typet &type)
Cast a typet to a pointer_typet.
const reference_typet & to_reference_type(const typet &type)
Cast a typet to a reference_typet.
bool simplify(exprt &expr, const namespacet &ns)
#define CHECK_RETURN(CONDITION)
#define UNREACHABLE
This should be used to mark dead code.
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
#define PRECONDITION(CONDITION)
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
API to expression classes.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_typet.
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
cpp_template_args_tct full_args
cpp_template_args_tct specialization_args