diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-03-29 20:29:26 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-03-29 20:29:26 +0000 |
commit | 50e10fa881de2b9fd82f83bc0c4c24227e2a4a97 (patch) | |
tree | 9cb10a80ad3e11c0cfaafc6f3b7ba397b73dd690 /gcc/cp/call.c | |
parent | 10c6dc8e3932d33c8e47e6706885d2412b29c069 (diff) | |
download | gcc-50e10fa881de2b9fd82f83bc0c4c24227e2a4a97.zip gcc-50e10fa881de2b9fd82f83bc0c4c24227e2a4a97.tar.gz gcc-50e10fa881de2b9fd82f83bc0c4c24227e2a4a97.tar.bz2 |
call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
2013-03-29 Paolo Carlini <paolo.carlini@oracle.com>
* call.c (add_builtin_candidate): Use TYPE_PTR_P and VOID_TYPE_P.
(build_op_call_1): Likewise.
(build_over_call): Likewise.
(compare_ics): Likewise.
* class.c (build_base_path): Likewise.
(resolve_address_of_overloaded_function): Likewise.
* cp-tree.h: Likewise.
* cvt.c (cp_convert_to_pointer): Likewise.
(convert_to_reference): Likewise.
(ocp_convert): Likewise.
(convert_force): Likewise, tidy.
* cxx-pretty-print.c (pp_cxx_postfix_expression): Likewise.
(pp_cxx_ptr_operator): Likewise.
* decl.c (duplicate_decls): Likewise.
(start_decl): Likewise.
(grok_op_properties): Likewise.
(start_preparsed_function): Likewise.
(store_parm_decls): Likewise.
(finish_function): Likewise.
* decl2.c (delete_sanity): Likewise.
(acceptable_java_type): Likewise.
(grokbitfield): Likewise.
(cp_reconstruct_complex_type): Likewise.
* error.c (dump_type_prefix): Likewise.
(dump_expr): Likewise.
* except.c (push_eh_cleanup): Likewise.
(complete_ptr_ref_or_void_ptr_p): Likewise.
(can_convert_eh): Likewise.
* init.c (build_new_1): Likewise.
(build_delete): Likewise.
(build_vec_delete): Likewise.
* mangle.c (write_type): Likewise.
* parser.c (lookup_literal_operator): Likewise.
* pt.c (convert_nontype_argument_function): Likewise.
(convert_nontype_argument): Likewise.
(tsubst): Likewise.
(unify): Likewise.
(dependent_type_p_r): Likewise.
* rtti.c (build_headof): Likewise.
(build_typeid): Likewise.
(build_dynamic_cast_1): Likewise.
(target_incomplete_p): Likewise.
(typeinfo_in_lib_p): Likewise.
* semantics.c (finish_omp_for): Likewise.
(cxx_eval_call_expression): Likewise.
(maybe_resolve_dummy): Likewise.
* tree.c (build_target_expr): Likewise.
(cp_build_qualified_type_real): Likewise.
* typeck.c (composite_pointer_type_r): Likewise.
(composite_pointer_type): Likewise.
(comp_except_types): Likewise.
(cxx_sizeof_nowarn): Likewise.
(string_conv_p): Likewise.
(cp_build_array_ref): Likewise.
(cp_build_function_call_vec): Likewise, also use TYPE_PTRFN_P.
(pointer_diff): Likewise.
(cp_build_addr_expr_1): Likewise.
(cp_build_unary_op): Likewise.
(build_static_cast_1): Likewise.
(cp_build_c_cast): Likewise.
(comp_ptr_ttypes_real): Likewise.
(ptr_reasonably_similar): Likewise.
(comp_ptr_ttypes_const): Likewise.
(casts_away_constness): Likewise.
(check_literal_operator_args): Likewise.
* typeck2.c (build_x_arrow): Likewise.
(add_exception_specifier): Likewise.
From-SVN: r197249
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 62d6e15..1c368ca 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -2285,7 +2285,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, T& operator*(T*); */ case INDIRECT_REF: - if (TREE_CODE (type1) == POINTER_TYPE + if (TYPE_PTR_P (type1) && !uses_template_parms (TREE_TYPE (type1)) && (TYPE_PTROB_P (type1) || TREE_CODE (TREE_TYPE (type1)) == FUNCTION_TYPE)) @@ -2301,7 +2301,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, T operator-(T); */ case UNARY_PLUS_EXPR: /* unary + */ - if (TREE_CODE (type1) == POINTER_TYPE) + if (TYPE_PTR_P (type1)) break; case NEGATE_EXPR: if (ARITHMETIC_TYPE_P (type1)) @@ -2325,8 +2325,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, where CV12 is the union of CV1 and CV2. */ case MEMBER_REF: - if (TREE_CODE (type1) == POINTER_TYPE - && TYPE_PTRMEM_P (type2)) + if (TYPE_PTR_P (type1) && TYPE_PTRMEM_P (type2)) { tree c1 = TREE_TYPE (type1); tree c2 = TYPE_PTRMEM_CLASS_TYPE (type2); @@ -2546,7 +2545,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code, || (TYPE_PTR_P (type1) && TYPE_PTR_P (type2)) || (TYPE_PTRDATAMEM_P (type1) && TYPE_PTRDATAMEM_P (type2)) || ((TYPE_PTRMEMFUNC_P (type1) - || TREE_CODE (type1) == POINTER_TYPE) + || TYPE_PTR_P (type1)) && null_ptr_cst_p (args[1]))) { type2 = type1; @@ -4083,12 +4082,12 @@ build_op_call_1 (tree obj, vec<tree, va_gc> **args, tsubst_flags_t complain) tree fns = TREE_VALUE (convs); tree totype = TREE_TYPE (convs); - if ((TREE_CODE (totype) == POINTER_TYPE + if ((TYPE_PTR_P (totype) && TREE_CODE (TREE_TYPE (totype)) == FUNCTION_TYPE) || (TREE_CODE (totype) == REFERENCE_TYPE && TREE_CODE (TREE_TYPE (totype)) == FUNCTION_TYPE) || (TREE_CODE (totype) == REFERENCE_TYPE - && TREE_CODE (TREE_TYPE (totype)) == POINTER_TYPE + && TYPE_PTR_P (TREE_TYPE (totype)) && TREE_CODE (TREE_TYPE (TREE_TYPE (totype))) == FUNCTION_TYPE)) for (; fns; fns = OVL_NEXT (fns)) { @@ -6766,7 +6765,7 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain) So we can assume that anything passed as 'this' is non-null, and optimize accordingly. */ - gcc_assert (TREE_CODE (parmtype) == POINTER_TYPE); + gcc_assert (TYPE_PTR_P (parmtype)); /* Convert to the base in which the function was declared. */ gcc_assert (cand->conversion_path != NULL_TREE); converted_arg = build_base_path (PLUS_EXPR, @@ -8136,8 +8135,8 @@ compare_ics (conversion *ics1, conversion *ics2) conversion of B* to A* is better than conversion of B* to void*, and conversion of A* to void* is better than conversion of B* to void*. */ - if (TREE_CODE (deref_to_type1) == VOID_TYPE - && TREE_CODE (deref_to_type2) == VOID_TYPE) + if (VOID_TYPE_P (deref_to_type1) + && VOID_TYPE_P (deref_to_type2)) { if (is_properly_derived_from (deref_from_type1, deref_from_type2)) @@ -8146,12 +8145,12 @@ compare_ics (conversion *ics1, conversion *ics2) deref_from_type1)) return 1; } - else if (TREE_CODE (deref_to_type1) == VOID_TYPE - || TREE_CODE (deref_to_type2) == VOID_TYPE) + else if (VOID_TYPE_P (deref_to_type1) + || VOID_TYPE_P (deref_to_type2)) { if (same_type_p (deref_from_type1, deref_from_type2)) { - if (TREE_CODE (deref_to_type2) == VOID_TYPE) + if (VOID_TYPE_P (deref_to_type2)) { if (is_properly_derived_from (deref_from_type1, deref_to_type1)) |