#include <overload_resolver.h>
Public Types | |
typedef Overload_candidate | Candidate |
Public Methods | |
Overload_resolver (bool is_operator) | |
void | add_arg (const Expr_result &res) |
void | set_object (const Expr_result &res) |
bool | is_object () const |
void | add_signature (Function_signature *sig) |
Add signature to candidate set, if it is viable. More... | |
void | add_signature_with_type (Function_signature *sig, Type t) |
void | add_builtin_incdec (bool is_increment) |
Add builtin "++" and "--" operators to the result set. More... | |
void | add_builtin_unary_ops (Type(*predicate)(Type t)) |
Add built-in unary operators. More... | |
void | add_builtin_binary_ops (Type(*predicate)(Type t1, Type t2)) |
Add built-in binary operators. More... | |
void | add_function (Function_symbol *fsym, bool allow_dups) |
Add all signatures of a function to candidate set. More... | |
Overload_candidate * | get_best (bool *is_ambig) |
unsigned | get_arg_count () const |
void | dump (std::ostream &os) |
Expr_result & | get_arg (int i) |
Private Methods | |
bool | have_signature (Function_signature *fsig, unsigned limit) |
Private Attributes | |
std::vector< Candidate * > | candidates |
bool | have_object |
bool | is_operator |
std::vector< Expr_result > | args |
Friends | |
class | Overload_candidate |
|
Definition at line 43 of file overload_resolver.h. Referenced by add_signature_with_type(). |
|
Definition at line 12 of file overload_resolver.cc. |
|
Definition at line 19 of file overload_resolver.cc. References args. Referenced by Expr_annotator::add_parms_from_arglist(), Expr_annotator::do_funcall(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_delete(), Expr_annotator::visit_new(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Add built-in binary operators. Unloke add_builtin_unary_ops, this one will also feed reference types into the predicate (i.e. "int&" and "long" in a "+=" expression).
Definition at line 225 of file overload_resolver.cc. References add_signature(), args, Conversion_op_map, enumerate_conversion_ops(), Type::get_return_type(), Type::is_valid(), Function_signature::make_builtin(), and Type::make_reference_type(). Referenced by Expr_annotator::visit_array(), and Expr_annotator::visit_assign(). |
|
Add builtin "++" and "--" operators to the result set. There are builtin ++ and -- operators for types "volatile T&" and "T&", where "T" is either an arithmetic type or pointer-to-object type Definition at line 159 of file overload_resolver.cc. References Function_type_maker::add_parameter(), add_signature(), args, Conversion_op_map, enumerate_conversion_ops(), Type::get_basis_type(), Type::get_kind(), Function_signature::get_proto_type(), Type::get_return_type(), Type::get_unqualified_type(), have_object, Type::is_arithmetic_type(), Type::is_object_type(), Type::is_qualified(), Type::is_same_unqualified_type(), Type::k_Pointer, Type::k_Reference, Function_signature::make_builtin(), Function_type_maker::make_function_type(), Type::make_reference_type(), and Type::q_Const. Referenced by Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Add built-in unary operators. Note that this one is only usable for operators which expect rvalues; it will never feed reference types into predicate.
Definition at line 203 of file overload_resolver.cc. References add_signature(), args, Conversion_op_map, enumerate_conversion_ops(), Type::is_valid(), and Function_signature::make_builtin(). Referenced by Expr_annotator::visit_arrowmember(), Expr_annotator::visit_delete(), and Expr_annotator::visit_unary(). |
|
Add all signatures of a function to candidate set. If allow_dups is true, a function which already is in the set will be added again; this will cause an ambiguity should that function be chosen. If allow_dups is false, duplicates will not be added. If the Function_symbol itself contains dupes, those will make it into the set, though (this is a feature). Definition at line 269 of file overload_resolver.cc. References add_signature(), candidates, have_signature(), Function_symbol::sig_begin(), Function_symbol::sig_end(), and Function_symbol::Sig_it. Referenced by Expr_annotator::do_funcall(), Init_handler::get_default_initializer_for_type(), Init_handler::make_constructor_call(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_new(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Add signature to candidate set, if it is viable. as_operator = true => if it is a member function, transform it into a function call (XX.operator(YY) => operator(XX, YY) Definition at line 42 of file overload_resolver.cc. References add_signature_with_type(), and Function_signature::get_proto_type(). Referenced by add_builtin_binary_ops(), add_builtin_incdec(), add_builtin_unary_ops(), add_function(), Expr_annotator::do_funcall(), and Expr_annotator::visit_unary(). |
|
Definition at line 50 of file overload_resolver.cc. References ICS_Types::a_Ellipsis, Implicit_conversion::add_conversion(), Overload_candidate::args, args, Candidate, candidates, generate_implicit_conversion(), Type::get_function_arg(), Type::get_kind(), Type::get_num_function_args(), Function_signature::get_storage_specifier(), Function_signature::get_this_type(), Type::k_Ellipsis, Type::make_reference_type(), and s_Member. Referenced by add_signature(). |
|
Definition at line 320 of file overload_resolver.cc. References Overload_candidate::args, candidates, Overload_candidate::fsig, Type::get_encoded_type(), and Function_signature::get_proto_type(). |
|
Definition at line 134 of file overload_resolver.h. References args. Referenced by Expr_annotator::do_funcall(), Init_handler::make_constructor_call(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_delete(), Expr_annotator::visit_new(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Definition at line 127 of file overload_resolver.h. References args. Referenced by Expr_annotator::do_funcall(), Init_handler::make_constructor_call(), and Expr_annotator::visit_new(). |
|
Definition at line 291 of file overload_resolver.cc. References candidates, Overload_candidate::fill_in_tree(), and Overload_candidate::is_better_than(). Referenced by Expr_annotator::do_funcall(), Init_handler::get_default_initializer_for_type(), Init_handler::make_constructor_call(), Expr_annotator::visit_array(), Expr_annotator::visit_arrowmember(), Expr_annotator::visit_assign(), Expr_annotator::visit_comma(), Expr_annotator::visit_delete(), Expr_annotator::visit_new(), Expr_annotator::visit_postfix(), and Expr_annotator::visit_unary(). |
|
Definition at line 280 of file overload_resolver.cc. References candidates. Referenced by add_function(). |
|
Definition at line 120 of file overload_resolver.h. References have_object. Referenced by Expr_annotator::do_funcall(). |
|
Definition at line 27 of file overload_resolver.cc. References args, have_object, and is_operator. Referenced by Expr_annotator::do_funcall(), and Expr_annotator::visit_assign(). |
|
Definition at line 53 of file overload_resolver.h. |
|
Definition at line 51 of file overload_resolver.h. Referenced by add_arg(), add_builtin_binary_ops(), add_builtin_incdec(), add_builtin_unary_ops(), add_signature_with_type(), Overload_candidate::fill_in_tree(), get_arg(), get_arg_count(), and set_object(). |
|
Definition at line 45 of file overload_resolver.h. Referenced by add_function(), add_signature_with_type(), dump(), get_best(), and have_signature(). |
|
Definition at line 47 of file overload_resolver.h. Referenced by add_builtin_incdec(), Overload_candidate::fill_in_tree(), is_object(), and set_object(). |
|
Definition at line 48 of file overload_resolver.h. Referenced by Overload_candidate::fill_in_tree(), and set_object(). |