39 original_scope(nullptr)
48 for(
const auto &id_ptr : id_set)
50 const cpp_idt &identifier = *id_ptr;
58 identifiers.push_back(e);
69 old_identifiers.swap(identifiers);
71 for(
const auto &old_id : old_identifiers)
81 identifiers.push_back(e);
92 old_identifiers.swap(identifiers);
94 for(
const auto &old_id : old_identifiers)
100 assert(e.
id()!=ID_type);
101 identifiers.push_back(e);
108 if(identifiers.size()==1)
111 exprt e=*identifiers.begin();
112 assert(e.
id()==ID_template_function_instance);
114 const symbolt &template_symbol=
130 identifiers.push_back(
139 old_identifiers.swap(identifiers);
141 for(
const auto &old_id : old_identifiers)
144 identifiers.push_back(old_id);
152 old_identifiers.swap(identifiers);
154 std::set<irep_idt> ids;
155 std::set<exprt> other;
157 for(
const auto &old_id : old_identifiers)
161 if(old_id.id() == ID_symbol)
163 else if(old_id.id() == ID_type && old_id.type().id() == ID_symbol_type)
165 else if(old_id.id() == ID_type && old_id.type().id() == ID_struct_tag)
167 else if(old_id.id() == ID_type && old_id.type().id() == ID_union_tag)
172 if(other.insert(old_id).second)
173 identifiers.push_back(old_id);
177 if(ids.insert(
id).second)
178 identifiers.push_back(old_id);
187 std::cout <<
"RESOLVE MAP:" << std::endl;
199 <<
"without instance:\n" 224 const symbolt &compound_symbol=
227 assert(compound_symbol.
type.
id()==ID_struct ||
228 compound_symbol.
type.
id()==ID_union);
234 struct_union_type.get_component(identifier.
identifier);
258 this_class_identifier <<
'\n';
261 const exprt &this_expr=
273 assert(this_expr.
type().
id()==ID_pointer);
276 object.type().set(ID_C_constant,
278 object.set(ID_C_lvalue,
true);
285 if(object_type.
id()==ID_struct ||
286 object_type.
id()==ID_union)
297 if(
object.is_not_nil())
336 else if(symbol.
type.
id()==ID_c_enum)
353 bool constant=followed_type.
get_bool(ID_C_constant);
355 while(followed_type.
id() == ID_symbol_type)
359 constant |= followed_type.
get_bool(ID_C_constant);
365 symbol.
value.
id() == ID_constant)
386 old_identifiers.swap(identifiers);
388 for(
const auto &old_id : old_identifiers)
395 match = (old_id.id() == ID_type);
399 match = (old_id.id() != ID_type);
411 identifiers.push_back(old_id);
423 old_identifiers.swap(identifiers);
428 for(
const auto &old_id : old_identifiers)
433 identifiers.push_back(old_id);
442 old_identifiers.swap(identifiers);
445 std::multimap<std::size_t, exprt> distance_map;
447 for(
const auto &old_id : old_identifiers)
449 unsigned args_distance;
453 std::size_t template_distance=0;
455 if(old_id.type().get(ID_C_template) !=
"")
456 template_distance = old_id.type()
457 .find(ID_C_template_arguments)
464 std::size_t total_distance=
466 1000*template_distance+args_distance;
468 distance_map.insert({total_distance, old_id});
475 if(!distance_map.empty())
477 std::size_t distance=distance_map.begin()->first;
479 for(std::multimap<std::size_t, exprt>::const_iterator
480 it=distance_map.begin();
481 it!=distance_map.end() && it->first==distance;
483 identifiers.push_back(it->second);
486 if(identifiers.size()>1 && fargs.
in_use)
490 for(resolve_identifierst::iterator
491 it1=identifiers.begin();
492 it1!=identifiers.end();
495 if(it1->type().id()!=ID_code)
501 for(resolve_identifierst::iterator it2=
503 it2!=identifiers.end();
512 if(it2->type().id()!=ID_code)
528 i<f1.
parameters().size() && (f1_better || f2_better);
540 if(type1.
id()==ID_pointer)
546 if(type2.
id()==ID_pointer)
555 if(followed1.
id() != ID_struct || followed2.
id() != ID_struct)
571 resolve_identifierst::iterator prev_it=it2;
574 if(f1_better && !f2_better)
575 identifiers.erase(prev_it);
586 for(
const auto &identifier : identifiers)
588 if(identifier.id() != ID_type)
591 new_identifiers.push_back(identifier);
606 exprt pod_constructor1(ID_pod_constructor, t1);
607 new_identifiers.push_back(pod_constructor1);
614 exprt pod_constructor2(ID_pod_constructor, t2);
615 new_identifiers.push_back(pod_constructor2);
619 if(symbol_type.
id()==ID_c_enum_tag)
623 exprt pod_constructor3(ID_pod_constructor, t3);
624 new_identifiers.push_back(pod_constructor3);
627 else if(symbol_type.
id()==ID_struct)
640 type.
id() == ID_code &&
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, " 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, " 782 <<
"template argument must be greater than zero" 791 <<
"template argument must be greater or equal zero" 796 if(integer_bits>width)
800 <<
"template argument must be smaller or equal width" 809 else if(base_name==ID_integer)
811 if(!arguments.empty())
815 << base_name <<
" expects no template arguments" 827 else if(base_name==
"dump_scopes")
835 else if(base_name==
"current_scope")
842 else if(base_name == ID_size_t)
846 else if(base_name == ID_ssize_t)
869 assert(!cpp_name.
get_sub().empty());
874 irept::subt::const_iterator
pos=cpp_name.
get_sub().begin();
886 std::string final_base_name=
"";
891 if(
pos->id()==ID_name)
892 final_base_name+=
pos->get_string(ID_identifier);
893 else if(
pos->id()==ID_template_args)
895 else if(
pos->id()==
"::")
909 std::cout <<
"X: " << id_set.size() <<
'\n';
940 else if(id_set.size()>=2)
945 << final_base_name <<
"' is ambiguous" 950 assert(id_set.size()==1);
964 final_base_name.clear();
966 else if(
pos->id()==ID_operator)
968 final_base_name+=
"operator";
970 irept::subt::const_iterator next=
pos+1;
971 assert(next != cpp_name.
get_sub().end());
974 next->id() == ID_cpp_name || next->id() == ID_pointer ||
975 next->id() == ID_int || next->id() == ID_char ||
976 next->id() == ID_c_bool || next->id() == ID_merged_type)
981 op_name.
swap(next_ir);
988 final_base_name+=
pos->id_string();
993 base_name=final_base_name;
1013 std::set<irep_idt> primary_templates;
1015 for(
const auto &id_ptr : id_set)
1017 const irep_idt id = id_ptr->identifier;
1025 if(specialization_of!=
"")
1026 primary_templates.insert(specialization_of);
1028 primary_templates.insert(
id);
1031 assert(!primary_templates.empty());
1033 if(primary_templates.size()>=2)
1042 const symbolt &primary_template_symbol=
1055 full_template_args_tc=
1058 primary_template_symbol,
1059 full_template_args);
1065 std::vector<matcht> matches;
1069 matcht(full_template_args_tc, full_template_args_tc,
1070 primary_template_symbol.
name));
1072 for(
const auto &id_ptr : id_set)
1074 const irep_idt id = id_ptr->identifier;
1095 assert(full_template_args_tc.
arguments().size()==
1096 partial_specialization_args.
arguments().size());
1101 static_cast<cpp_scopet *>(
1104 if(template_scope==
nullptr)
1108 <<
"class template instantiation error" 1116 for(std::size_t i=0; i<full_template_args_tc.
arguments().size(); i++)
1118 if(full_template_args_tc.
arguments()[i].id()==ID_type)
1120 full_template_args_tc.
arguments()[i].type());
1139 primary_template_symbol,
1140 partial_specialization_args);
1144 assert(partial_specialization_args_tc.
arguments().size()==
1145 full_template_args_tc.
arguments().size());
1147 if(partial_specialization_args_tc==
1148 full_template_args_tc)
1150 matches.push_back(
matcht(
1151 guessed_template_args, full_template_args_tc,
id));
1156 assert(!matches.empty());
1158 std::sort(matches.begin(), matches.end());
1161 for(std::vector<matcht>::const_iterator
1162 m_it=matches.begin();
1163 m_it!=matches.end();
1166 std::cout <<
"M: " << m_it->cost
1167 <<
" " << m_it->id <<
'\n';
1173 const matcht &match=*matches.begin();
1187 if(instance.
type.
id()!=ID_struct &&
1188 instance.
type.
id()!=ID_incomplete_struct)
1192 << base_name <<
"' is not a class";
1242 else if(id_set.size()==1)
1262 for(
const auto &id_expr : identifiers)
1266 if(id_expr.id()==ID_type)
1274 if(id_expr.type().get_bool(ID_is_template))
1277 if(id_expr.id()==ID_member)
1282 else if(id_expr.id() == ID_pod_constructor)
1284 out <<
"constructor ";
1287 else if(id_expr.id()==ID_template_function_instance)
1297 if(id_expr.type().get_bool(ID_is_template))
1300 else if(id_expr.type().id()==ID_code)
1306 out <<
" " <<
id <<
"(";
1310 for(
const auto ¶meter : parameters)
1312 const typet ¶meter_type = parameter.type();
1324 if(!parameters.empty())
1334 if(id_expr.id()==ID_symbol)
1337 out <<
" (" << symbol.
location <<
")";
1339 else if(id_expr.id()==ID_template_function_instance)
1343 out <<
" (" << symbol.
location <<
")";
1355 bool fail_with_exception)
1368 std::cout <<
"base name: " << base_name << std::endl;
1369 std::cout <<
"template args: " << template_args.
pretty() << std::endl;
1371 std::cout <<
"scope: " 1381 return do_builtin(base_name, fargs, template_args);
1385 if(base_name==
"__func__" ||
1386 base_name==
"__FUNCTION__" ||
1387 base_name==
"__PRETTY_FUNCTION__")
1394 return std::move(s);
1403 if(template_args.
is_nil())
1415 id_set.insert(&builtin_id);
1431 if(!fail_with_exception)
1441 << base_name <<
"' not found";
1454 << base_name <<
"' is unknown";
1469 bool have_classes=
false, have_methods=
false;
1471 for(
const auto &id_ptr : id_set)
1473 const irep_idt id = id_ptr->identifier;
1482 if(want==
wantt::BOTH && have_classes && have_methods)
1484 if(!fail_with_exception)
1490 <<
"template symbol `" 1502 identifiers.push_back(
exprt(ID_type, instance));
1508 id_set, fargs, identifiers);
1511 identifiers, template_args, fargs);
1517 id_set, fargs, identifiers);
1524 filter(identifiers, want);
1527 std::cout <<
"P0 " << base_name <<
" " << identifiers.
size() <<
"\n";
1540 std::cout <<
"P1 " << base_name <<
" " << new_identifiers.
size() <<
"\n";
1549 std::cout <<
"P2 " << base_name <<
" " << new_identifiers.
size() <<
"\n";
1555 if(new_identifiers.empty())
1557 new_identifiers=identifiers;
1559 if(template_args.
is_nil())
1563 if(new_identifiers.empty())
1564 new_identifiers=identifiers;
1570 std::cout <<
"P3 " << base_name <<
" " << new_identifiers.
size() <<
"\n";
1579 std::cout <<
"P4 " << base_name <<
" " << new_identifiers.
size() <<
"\n";
1584 if(new_identifiers.size()==1)
1586 result=*new_identifiers.begin();
1591 if(!fail_with_exception)
1594 if(new_identifiers.empty())
1598 <<
"found no match for symbol `" << base_name
1599 <<
"', candidates are:\n";
1606 <<
"symbol `" << base_name
1607 <<
"' does not uniquely resolve:\n";
1611 exprt e1=*new_identifiers.begin();
1612 exprt e2=*(++new_identifiers.begin());
1619 << (e1.get(ID_identifier)==e2.
get(ID_identifier))
1621 cpp_typecheck.str <<
"e1.iden:: " << e1.get(ID_identifier) <<
'\n';
1630 for(
const auto &op : fargs.
operands)
1647 if(result.
get_bool(ID_C_not_accessible))
1650 if(!fail_with_exception)
1655 <<
"error: member `" << result.
get(ID_component_name)
1656 <<
"' is not accessible";
1666 if(!fail_with_exception)
1672 <<
"error: expected expression, but got type `" 1681 if(result.
id()!=ID_type)
1683 if(!fail_with_exception)
1689 <<
"error: expected type, but got expression `" 1705 const exprt &template_expr,
1706 const exprt &desired_expr)
1708 if(template_expr.
id()==ID_cpp_name)
1725 for(
const auto &id_ptr : id_set)
1733 if(e.
id()==ID_unassigned)
1737 if(e.
type()!=old_type)
1747 const typet &template_type,
1748 const typet &desired_type)
1781 std::cout <<
"TT: " << template_type.
pretty() <<
'\n';
1782 std::cout <<
"DT: " << desired_type.
pretty() <<
'\n';
1785 if(template_type.
id()==ID_cpp_name)
1812 for(
const auto &id_ptr : id_set)
1821 if(t.
id()==ID_unassigned)
1829 std::cout <<
"ASSIGN " <<
id.identifier <<
" := " 1838 else if(template_type.
id()==ID_merged_type)
1851 else if(template_type.
id()==ID_pointer)
1853 const typet &desired_type_followed=
1856 if(desired_type_followed.
id()==ID_pointer)
1860 else if(template_type.
id()==ID_array)
1862 const typet &desired_type_followed=
1865 if(desired_type_followed.
id()==ID_array)
1870 desired_type_followed.
subtype());
1890 assert(expr.
id()==ID_symbol);
1898 if(cpp_declaration.is_class_template())
1910 const symbolt &template_symbol=
1918 cpp_declaration.template_type());
1921 assert(cpp_declaration.declarators().size()==1);
1924 cpp_declaration.declarators().front();
1927 if(function_declarator.type().id()!=ID_function_type)
1931 <<
"expected function type for function template" 1940 static_cast<cpp_scopet *>(
1943 if(template_scope==
nullptr)
1947 << template_identifier <<
'\n' 1948 <<
"function template instantiation error" 1958 function_declarator.type().find(ID_parameters).get_sub();
1960 exprt::operandst::const_iterator it=fargs.
operands.begin();
1961 for(
const auto ¶meter : parameters)
1966 if(parameter.id()==ID_cpp_declaration)
1977 merge_type(arg_declaration.
type());
1994 cpp_declaration.template_type());
2001 typet function_type=
2002 function_declarator.merge_type(cpp_declaration.type());
2008 function_type.
set(ID_C_template, template_symbol.
name);
2009 function_type.
set(ID_C_template_arguments, template_args);
2013 exprt template_function_instance(
2014 ID_template_function_instance, function_type);
2016 return template_function_instance;
2024 if(expr.
id()!=ID_symbol)
2027 const symbolt &template_symbol =
2034 if(template_args_non_tc.
is_nil())
2055 template_args_non_tc);
2094 code_type.
parameters()[0].get(ID_C_base_name)==ID_this)
2101 fargs.
operands.begin()->type().get(ID_identifier));
2103 assert(type_symb.
type.
id()==ID_struct);
2109 "method should exist in struct");
2128 unsigned &args_distance,
2138 if(expr.
id()==ID_member ||
2148 assert(parameter.
get(ID_C_base_name)==ID_this);
2155 object.set(ID_C_lvalue,
true);
2165 fargs.
operands.size() == parameters.size())
2197 for(
const auto &id_ptr : id_set)
2201 if(
id.is_class() ||
id.is_enum() ||
id.is_namespace())
2204 assert(
id.is_scope);
2205 new_set.insert(&
id);
2207 else if(
id.is_typedef())
2215 static_cast<const struct_typet &>(
2218 assert(pcomp.is_not_nil());
2219 assert(pcomp.get_bool(ID_is_type));
2220 const typet &type=pcomp.type();
2221 assert(type.id()!=ID_struct);
2223 if(type.id() == ID_symbol_type)
2235 if(symbol.
type.
id()==ID_struct)
2242 new_set.insert(&class_id);
2245 else if(symbol.
type.
id() == ID_symbol_type)
2259 if(symbol.
type.
id() == ID_struct)
2261 id.print(std::cout);
2262 assert(
id.is_scope);
2263 new_set.insert(&
id);
2282 std::cout <<
"E: " << e.
pretty() <<
'\n';
2288 if(e.
type().
id() == ID_symbol_type)
2299 if(symbol.
type.
id() == ID_symbol_type)
2301 else if(symbol.
type.
id()==ID_struct ||
2302 symbol.
type.
id()==ID_incomplete_struct ||
2303 symbol.
type.
id()==ID_union ||
2304 symbol.
type.
id()==ID_incomplete_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)
2355 if(final_type.
id()!=ID_struct && final_type.
id()!=ID_union)
2361 id_set.insert(tmp_set.begin(), tmp_set.end());
exprt convert_template_parameter(const cpp_idt &id)
The type of an expression, extends irept.
irep_idt name
The unique identifier.
void convert_identifiers(const cpp_scopest::id_sett &id_set, const cpp_typecheck_fargst &fargs, resolve_identifierst &identifiers)
C++ Language Type Checking.
source_locationt source_location
const std::string & id2string(const irep_idt &d)
bool match(const code_typet &code_type, unsigned &distance, cpp_typecheckt &cpp_typecheck) const
pointer_typet pointer_type(const typet &subtype)
std::set< cpp_idt * > id_sett
const std::string integer2string(const mp_integer &n, unsigned base)
void print(std::ostream &out, unsigned indent=0) const
bool has_unassigned() const
void set_value(const irep_idt &value)
std::string pretty(unsigned indent=0, unsigned max_indent=0) const
std::vector< irept > subt
exprt resolve(const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true)
instantiation_stackt instantiation_stack
exprt::operandst argumentst
irep_idt get_specialization_of() const
void guess_template_args(const typet &template_parameter, const typet &desired_type)
bool has_ellipsis() const
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=typet(ID_nil))
void clear()
Zero initialise a symbol object.
void remove_duplicates(resolve_identifierst &identifiers)
void typecheck_expr_member(exprt &) override
void resolve_argument(exprt &argument, const cpp_typecheck_fargst &fargs)
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
void disambiguate_functions(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
const irep_idt & get_function() const
cpp_template_args_tct typecheck_template_args(const source_locationt &source_location, const symbolt &template_symbol, const cpp_template_args_non_tct &template_args)
exprt::operandst operands
void copy_to_operands(const exprt &expr)
Copy the given argument to the end of exprt's operands.
void remove_templates(resolve_identifierst &identifiers)
const irep_idt & get_identifier() const
auto component(T &struct_expr, const irep_idt &name, const namespacet &ns) -> decltype(struct_expr.op0())
id_sett lookup(const irep_idt &base_name_to_lookup, lookup_kindt kind)
cpp_namet & to_cpp_name(irept &cpp_name)
void move_to_operands(exprt &expr)
Move the given argument to the end of exprt's operands.
cpp_scopet & get_parent() const
exprt do_builtin(const irep_idt &base_name, const cpp_typecheck_fargst &fargs, const cpp_template_args_non_tct &template_args)
const symbol_typet & to_symbol_type(const typet &type)
Cast a typet to a symbol_typet.
std::vector< parametert > parameterst
An expression denoting a type.
cpp_template_args_non_tct & partial_specialization_args()
void show_instantiation_stack(std::ostream &)
exprt value
Initial value of symbol.
const componentst & components() const
template_mapt template_map
bool has_component_rec(const typet &type, const irep_idt &component_name, const namespacet &ns)
cpp_template_args_tct & to_cpp_template_args_tc(irept &irep)
typet & type()
Return the type of the expression.
bool cpp_typecheck(cpp_parse_treet &cpp_parse_tree, symbol_tablet &symbol_table, const std::string &module, message_handlert &message_handler)
unsignedbv_typet size_type()
Structure type, corresponds to C style structs.
bool get_bool(const irep_namet &name) const
cpp_template_args_non_tct & to_cpp_template_args_non_tc(irept &irep)
bool is_qualified() const
signedbv_typet signed_size_type()
exprt lookup(const irep_idt &identifier) const
cpp_scopet & get_root_scope()
Extract member of struct or union.
mstreamt & warning() const
cpp_template_args_tct full_args
bool is_class_template() const
const irep_idt & id() const
const source_locationt & source_location() const
void elaborate_class_template(const typet &type)
elaborate class template instances
const declaratorst & declarators() const
void exact_match_functions(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
A reference into the symbol table.
void filter_for_namespaces(cpp_scopest::id_sett &id_set)
cpp_scopet * original_scope
const source_locationt & find_source_location() const
Get a source_locationt from the expression or from its operands (non-recursively).
const merged_typet & to_merged_type(const typet &type)
conversion to merged_typet
const union_tag_typet & to_union_tag_type(const typet &type)
Cast a typet to a union_tag_typet.
bool has_template_args() const
source_locationt source_location
bool cpp_is_pod(const typet &type) const
void typecheck_type(typet &) override
symbol_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
API to expression classes.
void filter(resolve_identifierst &identifiers, const wantt want)
bool is_reference(const typet &type)
Returns true if the type is a reference.
cpp_idt & get_id(const irep_idt &identifier)
const irep_idt & get(const irep_namet &name) const
bool has_prefix(const std::string &s, const std::string &prefix)
cpp_template_args_tct build_template_args(const template_typet &template_type) const
std::string cpp_type2name(const typet &type)
const struct_tag_typet & to_struct_tag_type(const typet &type)
Cast a typet to a struct_tag_typet.
Base class for tree-like data structures with sharing.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
irep_idt class_identifier
void add_object(const exprt &expr)
C++ Language Type Checking.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
const struct_typet & to_struct_type(const typet &type)
Cast a typet to a struct_typet.
symbol_exprt cpp_symbol_expr(const symbolt &symbol)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
exprt convert_identifier(const cpp_idt &id, const cpp_typecheck_fargst &fargs)
typet type
Type of symbol.
source_locationt location
Source code location of definition of symbol.
cpp_declarationt & to_cpp_declaration(irept &irep)
void guess_function_template_args(resolve_identifierst &identifiers, const cpp_typecheck_fargst &fargs)
guess arguments of function templates
bool subtype_typecast(const struct_typet &from, const struct_typet &to) const
void resolve_with_arguments(cpp_scopest::id_sett &id_set, const irep_idt &base_name, const cpp_typecheck_fargst &fargs)
cpp_template_args_tct specialization_args
Base type for structs and unions.
bool builtin_factory(const irep_idt &)
const array_typet & to_array_type(const typet &type)
Cast a typet to an array_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)
Base class for all expressions.
bool is_rvalue_reference(const typet &type)
Returns if the type is an R value reference.
const parameterst & parameters() const
cpp_scopet & current_scope()
void build_unassigned(const template_typet &template_type)
const struct_union_typet & to_struct_union_type(const typet &type)
Cast a typet to a struct_union_typet.
source_locationt & add_source_location()
const source_locationt & source_location() const
#define UNREACHABLE
This should be used to mark dead code.
void cpp_convert_plain_type(typet &type)
bool disable_access_control
void show_identifiers(const irep_idt &base_name, const resolve_identifierst &identifiers, std::ostream &out)
source_locationt & add_source_location()
cpp_typecheck_resolvet(class cpp_typecheckt &_cpp_typecheck)
bool is_number(const typet &type)
Returns true if the type is a rational, real, integer, natural, complex, unsignedbv,...
Expression to hold a symbol (variable)
cpp_scopet & get_scope(const irep_idt &identifier)
std::vector< exprt > resolve_identifierst
signedbv_typet signed_int_type()
void remove(const irep_namet &name)
void make_constructors(resolve_identifierst &identifiers)
const typet & subtype() const
void filter_for_named_scopes(cpp_scopest::id_sett &id_set)
#define DATA_INVARIANT(CONDITION, REASON)
This condition should be used to document that assumptions that are made on goto_functions,...
void apply_template_args(resolve_identifierst &identifiers, const cpp_template_args_non_tct &template_args, const cpp_typecheck_fargst &fargs)
template_typet & template_type()
std::string to_string(const typet &) override
bool is_root_scope() const
cpp_idt & insert(const irep_idt &_base_name)
void make_typecast(const typet &_type)
Create a typecast_exprt to the given type.
const irept & find(const irep_namet &name) const
C enum tag type, i.e., c_enum_typet with an identifier.
const typet & return_type() const
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const irep_idt & get_identifier() const
cpp_scopet & resolve_namespace(const cpp_namet &cpp_name)
void set(const irep_namet &name, const irep_idt &value)
const componentt & get_component(const irep_idt &component_name) const
Get the reference to a component with given name.
void print(std::ostream &out) const
cpp_typecheckt & cpp_typecheck
cpp_scopet & resolve_scope(const cpp_namet &cpp_name, irep_idt &base_name, cpp_template_args_non_tct &template_args)
C Language Type Checking.