From ba47d38d4c5d229c686e479fceb9ee9eb23442ff Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Tue, 23 Sep 2008 14:55:14 +0000 Subject: c-tree.h: Add argument to c_objc_common_truthvalue_conversion, parser_build_binary_op. * c-tree.h: Add argument to c_objc_common_truthvalue_conversion, parser_build_binary_op. * c-decl.c (build_enumerator): Pass location to build_binary_op. * c-typeck.c (build_array_ref): Same. (parser_build_unary_op): New location argument. (pointer_diff): Pass location to build_binary_op, c_objc_common_truthvalue_conversion. (build_modify_expr): Same. (build_unary_op): New location argument. (build_binary_op): New location argument. (c_objc_common_truthvalue_conversion): Pass location to c_*common_truthvalue_conversion. * c-convert.c (convert): Same. * c-common.c (binary_op_error): New location argument. (pointer_int_sum): Pass location to build_binary_op. (c_common_truthvalue_conversion): New location argument. (warn_for_sign_compare): Same. * c-common.h: Add location argument to c_common_truthvalue_conversion, binary_op_error, build_binary_op, warn_for_sign_compare. * c-parser.c (c_parser_condition): Pass location to c_*common_truthvalue_conversion. (c_parser_conditional_expression): Save condition's location and pass it on down. (c_parser_binary_expression): Same, but for the binary operator's location. (c_parser_omp_for_loop): Pass location to c_objc_common_truthvalue_conversion. objc/ * objc-act.c (next_sjlj_build_enter_and_setjmp): Call c_common_truthvalue_conversion with location. (next_sjlj_build_catch_list): Same. (next_sjlj_build_try_catch_finally): Same. testsuite/ * gcc.dg/Walways-true-1.c: Test column numbers. * gcc.dg/c90-const-expr-5.c: Same. * gcc.dg/compare4.c: Same. * gcc.dg/Werror-1.c: Same. cp/ * typeck.c (build_array_ref): Pass location to cp_build_binary_op. (get_member_function_from_ptrfunc): Same. (build_x_binary_op): Same. (build_binary_op): Same. (cp_build_binary_op): New location argument. (pointer_diff): Pass location to cp_build_binary_op. (cp_truthvalue_conversion): Pass location to build_binary_op. (convert_ptrmem): Pass location to cp_build_binary_op. (cp_build_modify_expr): Same. (build_ptrmemfunc): Same. * init.c (expand_cleanup_for_base): Pass location to c_common_truthvalue_conversion. (build_new_1): Pass location to cp_build_binary_op. (build_vec_delete_1): Pass location to *build_binary_op, c_common_truthvalue_conversion. (build_vec_init): Same. (build_delete): Same. * decl.c (compute_array_index_type): Same. * call.c (build_new_op): Same. * rtti.c (build_dynamic_cast_1): Same. * cp-tree.h: Add argument to cp_build_binary_op. * semantics.c (handle_omp_for_class_iterator): Pass location to *build_binary_op, c_common_truthvalue_conversion. * decl2.c (get_guard_cond): Same. From-SVN: r140598 --- gcc/c-common.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gcc/c-common.h') diff --git a/gcc/c-common.h b/gcc/c-common.h index 96c5fa0..9621b05 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -714,13 +714,13 @@ extern tree c_common_signed_type (tree); extern tree c_common_signed_or_unsigned_type (int, tree); extern tree c_build_bitfield_integer_type (unsigned HOST_WIDE_INT, int); extern bool decl_with_nonnull_addr_p (const_tree); -extern tree c_common_truthvalue_conversion (tree); +extern tree c_common_truthvalue_conversion (location_t, tree); extern void c_apply_type_quals_to_decl (int, tree); extern tree c_sizeof_or_alignof_type (tree, bool, int); extern tree c_alignof_expr (tree); /* Print an error message for invalid operands to arith operation CODE. NOP_EXPR is used as a special case (see truthvalue_conversion). */ -extern void binary_op_error (enum tree_code, tree, tree); +extern void binary_op_error (location_t, enum tree_code, tree, tree); extern tree fix_string_type (tree); struct varray_head_tag; extern void constant_expression_warning (tree); @@ -817,7 +817,7 @@ extern tree build_case_label (tree, tree, tree); a variant of the C language. They are used in c-common.c. */ extern tree build_unary_op (enum tree_code, tree, int); -extern tree build_binary_op (enum tree_code, tree, tree, int); +extern tree build_binary_op (location_t, enum tree_code, tree, tree, int); extern tree perform_integral_promotions (tree); /* These functions must be defined by each front-end which implements @@ -917,7 +917,8 @@ extern void warn_about_parentheses (enum tree_code, enum tree_code, enum tree_code); extern void warn_for_unused_label (tree label); extern void warn_for_div_by_zero (tree divisor); -extern void warn_for_sign_compare (tree orig_op0, tree orig_op1, +extern void warn_for_sign_compare (location_t, + tree orig_op0, tree orig_op1, tree op0, tree op1, tree result_type, enum tree_code resultcode); -- cgit v1.1