#include "implicit_conversion.h"
#include "implicit_conversion_i.h"
Include dependency graph for implicit_conversion.cc:
Go to the source code of this file.
Functions | |
bool | is_ptr_to_bool (Implicit_conversion::Step_vec::const_iterator p) |
True iff p is a conversion of a pointer to bool. More... | |
Class_symbol * | class_or_null (const Type &t) |
Implicit_conversion::Action | fundamental_conversion_type (Type src, Type dest) |
Given two fundamental types, figure out how we can convert between them. More... | |
bool | gen_builtin_conversions (Implicit_conversion *ics, Type arg_type) |
Generate (partial) implicit conversion which converts /ics/ to /arg_type/. More... | |
void | gen_constructors (const Expr_result &expr, Type arg_type, Function_signature *symbol_hint, std::vector< Implicit_conversion * > *icv) |
Generate all conversions that are possible with constructors. More... | |
bool | gen_conv_ops (const Expr_result &expr, Type arg_type, Function_signature *symbol_hint, std::vector< Implicit_conversion * > *icv) |
Generate all conversions using a conversion function. More... | |
bool | operator== (const ICS_Step &lhs, const ICS_Step &rhs) |
void | enumerate_conversion_ops (const Expr_result &expr, Conversion_op_map *output) |
void | gen_candidates (Expr_result expr, Type arg_type, Function_signature *symbol_hint, bool with_userdef, bool is_object, std::vector< Implicit_conversion * > *candidates) |
Generate all implicit conversion candidates for an expression. More... | |
Implicit_conversion * | generate_implicit_conversion (Expr_result expr, Type arg_type, Function_signature *symbol_hint, bool with_userdef, bool is_copy_initialisation, bool is_implicit_object_arg) |
Generate all ICS's and return the best one. More... |
|
Definition at line 200 of file implicit_conversion.cc. References Type::get_kind(), Type::get_type_symbol(), and Type::k_Userdef. Referenced by Implicit_conversion::scs_is_better_than(). |
|
|
Given two fundamental types, figure out how we can convert between them. We can convert any fundamental type (except void) into any of the others, so no validity checks needed here. Definition at line 664 of file implicit_conversion.cc. References ICS_Types::a_BoolConversion, ICS_Types::a_FloatingConversion, ICS_Types::a_FloatingIntegralConversion, ICS_Types::a_FloatingPromotion, ICS_Types::a_IntegralConversion, ICS_Types::a_IntegralPromotion, Type::get_kind(), Type::get_promoted_integer(), Type::get_unqualified_type(), Type::is_float(), Type::is_int(), Type::is_same_unqualified_type(), Type::is_valid(), Type::is_void(), and Type::k_Fundamental. Referenced by gen_builtin_conversions(). |
|
|
|
Generate all conversions that are possible with constructors.
Definition at line 892 of file implicit_conversion.cc. References ICS_Types::a_CtorCall, Implicit_conversion::add_step(), Symbol_name::CONSTRUCTOR_NAME, Implicit_conversion::convert_to_rvalue(), f_Explicit, generate_implicit_conversion(), Type::get_function_arg(), Function_signature::get_function_specifiers(), Type::get_kind(), Type::get_num_function_args(), Function_signature::get_proto_type(), Class_symbol::get_scope(), Type::get_type_symbol(), Type::get_unqualified_type(), Symbol::is_declared(), Symbol::is_defined(), Expr_result::k_RValue, Type::k_Userdef, Class_scope::lookup_here(), Function_symbol::sig_begin(), Function_symbol::sig_end(), Function_symbol::Sig_it, Implicit_conversion::Step, and Symbol_pair::untag. Referenced by gen_candidates(). |
|
Generate all conversions using a conversion function. Returns true if there was at least one such conversion. Definition at line 1016 of file implicit_conversion.cc. References ICS_Types::a_ConversionOp, Implicit_conversion::add_step(), Implicit_conversion::append_from(), Conversion_op_map, Implicit_conversion::convert_reference(), enumerate_conversion_ops(), generate_implicit_conversion(), Expr_result::get_kind(), Expr_result::get_type(), Implicit_conversion::set_ambiguous(), Expr_result::set_value(), and Implicit_conversion::Step. Referenced by gen_candidates(). |
|
Generate all ICS's and return the best one. Returns an ambiguous sequence if conversion is ambiguous, null if impossible. Definition at line 1171 of file implicit_conversion.cc. References ICS_Types::c_CompareBeforeUserConversion, ICS_Types::c_CompareWithInitRules, ICS_Types::Compare, gen_candidates(), Expr_result::get_type(), Implicit_conversion::is_better_than(), Type::is_class_type(), Type::is_same_unqualified_type(), Type::is_void(), and Implicit_conversion::set_ambiguous(). Referenced by Overload_resolver::add_signature_with_type(), gen_candidates(), gen_constructors(), gen_conv_ops(), generate_ics_for_ternary(), Init_handler::get_default_initializer_for_type(), Init_handler::make_constructor_call(), Init_handler::process_brace(), Init_handler::process_class(), Expr_annotator::try_static_cast(), Expr_annotator::visit_assign(), Expr_annotator::visit_cond(), Annotator::visit_do(), Annotator::visit_for(), Annotator::visit_if(), Annotator::visit_return(), Annotator::visit_switch(), and Annotator::visit_while(). |
|
True iff p is a conversion of a pointer to bool.
Definition at line 53 of file implicit_conversion.cc. References ICS_Types::a_BoolConversion, Type::k_Member, and Type::k_Pointer. Referenced by Implicit_conversion::scs_is_better_than(). |
|
Definition at line 536 of file implicit_conversion.cc. References ICS_Step::action, ICS_Step::function, ICS_Step::kind, and ICS_Step::type. |