cprover
|
#include <cpp_typecheck_resolve.h>
Classes | |
struct | matcht |
Public Types | |
enum | wantt { wantt::VAR, wantt::TYPE, wantt::BOTH } |
Public Member Functions | |
cpp_typecheck_resolvet (class cpp_typecheckt &_cpp_typecheck) | |
exprt | resolve (const cpp_namet &cpp_name, const wantt want, const cpp_typecheck_fargst &fargs, bool fail_with_exception=true) |
cpp_scopet & | resolve_scope (const cpp_namet &cpp_name, irep_idt &base_name, cpp_template_args_non_tct &template_args) |
cpp_scopet & | resolve_namespace (const cpp_namet &cpp_name) |
Protected Types | |
typedef std::vector< exprt > | resolve_identifierst |
Protected Attributes | |
cpp_typecheckt & | cpp_typecheck |
source_locationt | source_location |
cpp_scopet * | original_scope |
Definition at line 20 of file cpp_typecheck_resolve.h.
|
protected |
Definition at line 48 of file cpp_typecheck_resolve.h.
|
strong |
Enumerator | |
---|---|
VAR | |
TYPE | |
BOTH |
Definition at line 26 of file cpp_typecheck_resolve.h.
cpp_typecheck_resolvet::cpp_typecheck_resolvet | ( | class cpp_typecheckt & | _cpp_typecheck | ) |
Definition at line 32 of file cpp_typecheck_resolve.cpp.
|
protected |
Definition at line 61 of file cpp_typecheck_resolve.cpp.
References irept::id(), irept::is_not_nil(), and exprt::type().
Referenced by resolve().
|
protected |
Definition at line 2038 of file cpp_typecheck_resolve.cpp.
References exprt::add_source_location(), cpp_typecheckt::cpp_scopes, cpp_symbol_expr(), cpp_typecheck, irept::get(), irept::get_bool(), cpp_scopest::go_to(), guess_function_template_args(), cpp_typecheck_fargst::has_object, cpp_template_args_tct::has_unassigned(), irept::id(), cpp_typecheckt::instantiate_template(), cpp_declarationt::is_class_template(), irept::is_nil(), namespacet::lookup(), symbolt::name, cpp_typecheck_fargst::operands, original_scope, code_typet::parameters(), source_location, irept::swap(), to_code_type(), to_cpp_declaration(), to_struct_type(), symbolt::type, and cpp_typecheckt::typecheck_template_args().
|
protected |
Definition at line 210 of file cpp_typecheck_resolve.cpp.
References exprt::add_source_location(), cpp_idt::class_identifier, convert_template_parameter(), exprt::copy_to_operands(), cpp_typecheckt::cpp_scopes, cpp_symbol_expr(), cpp_typecheck, cpp_scopest::current_scope(), cpp_typecheckt::disable_access_control, namespace_baset::follow(), irept::get_bool(), has_component_rec(), cpp_typecheck_fargst::has_object, irept::id(), cpp_idt::id_class, cpp_idt::identifier, cpp_idt::is_constructor, symbolt::is_macro, cpp_idt::is_member, cpp_idt::is_method, irept::is_not_nil(), is_number(), cpp_idt::is_static_member, symbolt::is_type, namespacet::lookup(), irept::make_nil(), exprt::move_to_operands(), symbolt::name, cpp_typecheck_fargst::operands, original_scope, irept::set(), source_location, typet::subtype(), cpp_idt::SYMBOL, cpp_idt::TEMPLATE_PARAMETER, cpp_idt::this_expr, to_struct_union_type(), symbolt::type, exprt::type(), cpp_typecheckt::typecheck_expr_member(), cpp_idt::TYPEDEF, and symbolt::value.
Referenced by convert_identifiers().
|
protected |
Definition at line 37 of file cpp_typecheck_resolve.cpp.
References convert_identifier(), irept::id(), irept::is_not_nil(), and exprt::type().
Referenced by resolve().
Definition at line 189 of file cpp_typecheck_resolve.cpp.
References exprt::add_source_location(), cpp_typecheck, messaget::eom(), messaget::error(), irept::id(), cpp_idt::identifier, irept::is_nil(), template_mapt::lookup(), source_location, messaget::mstreamt::source_location, cpp_typecheckt::template_map, and exprt::type().
Referenced by convert_identifier().
|
protected |
Definition at line 440 of file cpp_typecheck_resolve.cpp.
References cpp_typecheck, namespace_baset::follow(), irept::id(), cpp_typecheck_fargst::in_use, is_reference(), code_typet::parameters(), typet::subtype(), cpp_typecheckt::subtype_typecast(), to_code_type(), and to_struct_type().
Referenced by exact_match_functions(), guess_function_template_args(), and resolve().
|
protected |
Definition at line 2142 of file cpp_typecheck_resolve.cpp.
References cpp_typecheck_fargst::add_object(), cpp_typecheck, irept::get(), irept::get_bool(), cpp_typecheck_fargst::has_object, irept::id(), cpp_typecheck_fargst::in_use, cpp_typecheck_fargst::match(), exprt::op0(), cpp_typecheck_fargst::operands, code_typet::parameters(), cpp_typecheck_fargst::remove_object(), code_typet::return_type(), typet::subtype(), to_code_type(), and exprt::type().
|
protected |
disambiguate partial specialization
Definition at line 1006 of file cpp_typecheck_resolve.cpp.
References typet::add_source_location(), cpp_template_args_baset::arguments(), template_mapt::build_template_args(), template_mapt::build_unassigned(), cpp_typecheckt::class_template_symbol(), cpp_typecheckt::cpp_scopes, cpp_typecheck, messaget::eom(), messaget::error(), cpp_typecheck_resolvet::matcht::full_args, irept::get(), irept::get_bool(), cpp_declarationt::get_specialization_of(), cpp_scopest::go_to(), guess_template_args(), cpp_typecheck_resolvet::matcht::id, irept::id(), cpp_scopest::id_map, cpp_typecheckt::instantiate_template(), cpp_declarationt::is_class_template(), namespacet::lookup(), symbolt::name, original_scope, cpp_declarationt::partial_specialization_args(), cpp_typecheckt::show_instantiation_stack(), source_location, messaget::mstreamt::source_location, cpp_typecheck_resolvet::matcht::specialization_args, cpp_typecheckt::template_map, cpp_declarationt::template_type(), to_cpp_declaration(), symbolt::type, and cpp_typecheckt::typecheck_template_args().
Referenced by resolve(), and resolve_scope().
|
protected |
Definition at line 676 of file cpp_typecheck_resolve.cpp.
References cpp_template_args_baset::arguments(), cpp_typecheckt::cpp_scopes, cpp_typecheck, messaget::eom(), messaget::error(), exprt::find_source_location(), cpp_scopest::get_root_scope(), has_prefix(), irept::id(), id2string(), integer2string(), original_scope, cpp_idt::prefix, cpp_idt::print(), irept::set(), signed_size_type(), dstringt::size(), size_type(), source_location, messaget::mstreamt::source_location, to_integer(), exprt::type(), and messaget::warning().
Referenced by resolve().
|
protected |
Definition at line 415 of file cpp_typecheck_resolve.cpp.
References disambiguate_functions(), and cpp_typecheck_fargst::in_use.
Referenced by resolve().
|
protected |
|
protected |
Definition at line 2204 of file cpp_typecheck_resolve.cpp.
References cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_scopest::current_scope(), irept::get(), irept::get_bool(), struct_union_typet::get_component(), cpp_scopest::get_id(), symbol_typet::get_identifier(), cpp_scopet::get_parent(), irept::id(), id_class, cpp_idt::identifier, irept::is_not_nil(), cpp_idt::is_scope, symbolt::is_type, template_mapt::lookup(), namespacet::lookup(), irept::pretty(), template_mapt::print(), cpp_idt::TEMPLATE, cpp_typecheckt::template_map, cpp_idt::TEMPLATE_PARAMETER, to_symbol_type(), symbolt::type, and exprt::type().
Referenced by resolve_scope().
|
protected |
Definition at line 2342 of file cpp_typecheck_resolve.cpp.
Referenced by resolve_namespace().
|
protected |
guess arguments of function templates
Definition at line 88 of file cpp_typecheck_resolve.cpp.
References symbolt::clear(), cpp_typecheck, disambiguate_functions(), irept::find(), irept::get(), irept::id(), cpp_typecheckt::instantiate_template(), irept::is_not_nil(), namespacet::lookup(), source_location, to_cpp_template_args_tc(), and exprt::type().
Referenced by apply_template_args(), and resolve().
|
protected |
Guess template arguments for function templates.
Definition at line 1899 of file cpp_typecheck_resolve.cpp.
References template_mapt::build_template_args(), template_mapt::build_unassigned(), cpp_convert_plain_type(), cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_declarationt::declarators(), messaget::eom(), messaget::error(), namespace_baset::follow_symbol(), irept::get_bool(), symbol_exprt::get_identifier(), cpp_scopest::go_to(), guess_template_args(), cpp_template_args_tct::has_unassigned(), irept::id(), cpp_scopest::id_map, namespacet::lookup(), symbolt::name, cpp_typecheck_fargst::operands, irept::set(), source_location, messaget::mstreamt::source_location, cpp_typecheckt::template_map, to_cpp_declaration(), to_symbol_expr(), exprt::type(), and cpp_typecheckt::typecheck_type().
|
protected |
Definition at line 1757 of file cpp_typecheck_resolve.cpp.
References cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_scopest::current_scope(), namespace_baset::follow(), cpp_namet::has_template_args(), irept::id(), id_class, id_set, cpp_namet::is_qualified(), is_reference(), is_rvalue_reference(), cpp_scopet::lookup(), irept::pretty(), cpp_scopet::RECURSIVE, irept::remove(), resolve_scope(), typet::subtype(), typet::subtypes(), cpp_typecheckt::template_map, cpp_idt::TEMPLATE_PARAMETER, to_array_type(), to_cpp_name(), cpp_typecheckt::to_string(), and template_mapt::type_map.
Referenced by disambiguate_template_classes(), and guess_function_template_args().
|
protected |
Definition at line 1712 of file cpp_typecheck_resolve.cpp.
References cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_scopest::current_scope(), template_mapt::expr_map, irept::id(), id_class, id_set, cpp_namet::is_qualified(), cpp_scopet::lookup(), exprt::make_typecast(), cpp_scopet::RECURSIVE, resolve_scope(), cpp_typecheckt::template_map, cpp_idt::TEMPLATE_PARAMETER, to_cpp_name(), and exprt::type().
|
protected |
Definition at line 585 of file cpp_typecheck_resolve.cpp.
References struct_union_typet::components(), cpp_typecheckt::cpp_is_pod(), cpp_symbol_expr(), cpp_typecheck, irept::find(), namespace_baset::follow(), irept::get_bool(), struct_union_typet::componentt::get_name(), irept::id(), namespacet::lookup(), code_typet::parameters(), code_typet::return_type(), signed_int_type(), irept::swap(), to_struct_type(), and exprt::type().
Referenced by resolve().
|
protected |
Definition at line 155 of file cpp_typecheck_resolve.cpp.
Referenced by resolve().
|
protected |
Definition at line 139 of file cpp_typecheck_resolve.cpp.
References cpp_typecheck, and namespace_baset::follow().
Referenced by resolve().
exprt cpp_typecheck_resolvet::resolve | ( | const cpp_namet & | cpp_name, |
const wantt | want, | ||
const cpp_typecheck_fargst & | fargs, | ||
bool | fail_with_exception = true |
||
) |
Definition at line 1374 of file cpp_typecheck_resolve.cpp.
References exprt::add_source_location(), apply_template_args(), BOTH, dstringt::c_str(), convert_identifiers(), cpp_typecheckt::cpp_is_pod(), cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_scopest::current_scope(), disambiguate_functions(), disambiguate_template_classes(), do_builtin(), messaget::eom(), messaget::error(), exact_match_functions(), filter(), irept::get(), irept::get_bool(), source_locationt::get_function(), guess_function_template_args(), cpp_typecheck_fargst::has_object, irept::id(), id_set, cpp_idt::identifier, cpp_typecheck_fargst::in_use, cpp_typecheckt::instantiation_stack, cpp_declarationt::is_class_template(), irept::is_nil(), irept::is_not_nil(), cpp_namet::is_qualified(), cpp_scopet::is_root_scope(), cpp_scopet::lookup(), namespacet::lookup(), make_constructors(), irept::make_nil(), cpp_typecheck_fargst::operands, original_scope, cpp_idt::prefix, cpp_scopet::QUALIFIED, cpp_scopet::RECURSIVE, remove_duplicates(), remove_templates(), resolve_scope(), resolve_with_arguments(), string_constantt::set_value(), show_identifiers(), cpp_typecheckt::show_instantiation_stack(), dstringt::size(), source_location, cpp_namet::source_location(), exprt::source_location(), messaget::mstreamt::source_location, cpp_idt::TEMPLATE, to_cpp_declaration(), cpp_typecheckt::to_string(), TYPE, symbolt::type, exprt::type(), and VAR.
Referenced by cpp_typecheckt::resolve().
cpp_scopet & cpp_typecheck_resolvet::resolve_namespace | ( | const cpp_namet & | cpp_name | ) |
Definition at line 1233 of file cpp_typecheck_resolve.cpp.
References cpp_typecheckt::cpp_scopes, cpp_typecheck, cpp_scopest::current_scope(), messaget::eom(), messaget::error(), filter_for_namespaces(), id_set, cpp_namet::is_qualified(), cpp_scopet::lookup(), irept::make_nil(), cpp_scopet::QUALIFIED, cpp_scopet::RECURSIVE, resolve_scope(), source_location, cpp_namet::source_location(), and messaget::mstreamt::source_location.
Referenced by cpp_typecheckt::convert().
cpp_scopet & cpp_typecheck_resolvet::resolve_scope | ( | const cpp_namet & | cpp_name, |
irep_idt & | base_name, | ||
cpp_template_args_non_tct & | template_args | ||
) |
Definition at line 865 of file cpp_typecheck_resolve.cpp.
References typet::add_source_location(), cpp_idt::class_identifier, cpp_typecheckt::cpp_scopes, cpp_type2name(), cpp_typecheck, cpp_scopest::current_scope(), disambiguate_template_classes(), cpp_typecheckt::elaborate_class_template(), dstringt::empty(), messaget::eom(), messaget::error(), filter_for_named_scopes(), symbol_typet::get_identifier(), cpp_scopest::get_scope(), irept::get_sub(), cpp_scopest::go_to(), cpp_scopest::go_to_root_scope(), irept::id(), id_set, irept::is_not_nil(), cpp_scopet::lookup(), irept::make_nil(), original_scope, pos(), cpp_scopet::QUALIFIED, cpp_scopet::RECURSIVE, cpp_typecheckt::show_instantiation_stack(), source_location, cpp_namet::source_location(), messaget::mstreamt::source_location, irept::swap(), cpp_idt::TEMPLATE, to_cpp_template_args_non_tc(), and cpp_typecheckt::typecheck_type().
Referenced by cpp_declarator_convertert::convert(), cpp_typecheckt::convert(), guess_template_args(), resolve(), resolve_namespace(), and cpp_typecheckt::typecheck_compound_type().
|
protected |
Definition at line 2362 of file cpp_typecheck_resolve.cpp.
References cpp_typecheckt::cpp_scopes, cpp_typecheck, namespace_baset::follow(), irept::get(), cpp_scopest::get_scope(), irept::id(), cpp_scopet::lookup(), cpp_typecheck_fargst::operands, and cpp_scopet::SCOPE_ONLY.
Referenced by resolve().
|
protected |
Definition at line 1278 of file cpp_typecheck_resolve.cpp.
References cpp_typecheck, irept::get(), irept::get_bool(), code_typet::has_ellipsis(), irept::id(), id2string(), symbolt::location, namespacet::lookup(), code_typet::parameters(), code_typet::return_type(), to_code_type(), cpp_typecheckt::to_string(), to_symbol_expr(), and exprt::type().
Referenced by resolve().
|
protected |
Definition at line 44 of file cpp_typecheck_resolve.h.
Referenced by apply_template_args(), convert_identifier(), convert_template_parameter(), disambiguate_functions(), disambiguate_template_classes(), do_builtin(), filter_for_named_scopes(), guess_function_template_args(), guess_template_args(), make_constructors(), remove_templates(), resolve(), resolve_namespace(), resolve_scope(), resolve_with_arguments(), and show_identifiers().
|
protected |
Definition at line 46 of file cpp_typecheck_resolve.h.
Referenced by apply_template_args(), convert_identifier(), disambiguate_template_classes(), do_builtin(), resolve(), and resolve_scope().
|
protected |
Definition at line 45 of file cpp_typecheck_resolve.h.
Referenced by apply_template_args(), convert_identifier(), convert_template_parameter(), disambiguate_template_classes(), do_builtin(), guess_function_template_args(), resolve(), resolve_namespace(), and resolve_scope().