diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2008-10-06 21:35:02 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2008-10-06 21:35:02 +0000 |
commit | c9f9eb5d07ca96c57d89e5cb8ba3b3dfe588e151 (patch) | |
tree | 1143aed4f086c080db0a92f3dcf75640658aa713 /gcc/cp | |
parent | 7a3446ec7cdc75bedc1e0b47daea93146c5f8a78 (diff) | |
download | gcc-c9f9eb5d07ca96c57d89e5cb8ba3b3dfe588e151.zip gcc-c9f9eb5d07ca96c57d89e5cb8ba3b3dfe588e151.tar.gz gcc-c9f9eb5d07ca96c57d89e5cb8ba3b3dfe588e151.tar.bz2 |
c-decl.c (finish_decl): Pass input_location to build_unary_op.
* c-decl.c (finish_decl): Pass input_location to build_unary_op.
* c-typeck.c (array_to_pointer_conversion): Pass location to
build_unary_op.
(function_to_pointer_conversion): Use error_at and warning_at.
(build_indirect_ref): Same.
(build_array_ref): Pass location to build_binary_op.
(parser_build_unary_op): Do not set location after calling
build_unary_op.
(build_unary_op): Add location argument. Use it throughout. Set
EXPR_LOCATION before returning new tree.
(build_modify_expr): Same.
(build_binary_op): Use location throughout. Set EXPR_LOCATION before
returning node.
* c-omp.c (c_finish_omp_atomic): Pass location to build_unary_op,
build_indirect_ref, build_modify_expr.
(c_finish_omp_for): Same. Use error_at instead of error.
* c-common.c (c_common_truthvalue_conversion): Pass location to
build_unary_op.
(warn_for_div_by_zero): Add location argument.
* c-common.h: Add argument to build_modify_expr, build_indirect_ref,
build_unary_op, warn_for_div_by_zero.
* c-parser.c (c_parser_typeof_specifier): Use
protected_set_expr_location.
(c_parser_statement_after_labels): Same.
(c_parser_condition): Same.
(c_parser_expr_no_commas): Pass correct location to build_modify_expr.
(c_parser_conditional_expression): Use protected_set_expr_location.
(c_parser_unary_expression): Pass location to build_indirect_ref.
(c_parser_postfix_expression_after_primary): Pass location to
build_indirect_ref, build_unary_op.
(c_parser_omp_for_loop): Set the increment expression's EXPR_LOCATION.
objc/
* objc-act.c (objc_build_string_object): Pass location to
build_unary_op.
(init_def_list): Same.
(init_objc_symtab): Same.
(init_module_descriptor): Same.
(build_module_initializer_routine): Same.
(generate_static_references): Same.
(build_typed_selector_reference): Same.
(add_objc_string): Same.
(objc_substitute_decl): Same.
(objc_build_ivar_assignment): Same.
(objc_build_global_assignment): Same.
(objc_build_strong_cast_assignment): Same.
(generate_protocols): Same.
(build_protocol_initializer): Same.
(build_dispatch_table_initializer): Same.
(generate_protocol_list): Same.
(build_category_initializer): Same.
(build_shared_structure_initializer): Same.
(generate_shared_structures): Same.
(objc_build_protocol_expr): Same.
(build_ivar_reference): Same.
(get_super_receiver): Same.
build_modify_expr.
testsuite/
* gcc.dg/gomp/for-1.c: Test column.
* gcc.dg/misc-column.c: Add column tests for unary arguments.
cp/
* typeck.c (build_x_indirect_ref): Add location argument.
(cp_build_binary_op): Pass location to warn_for_div_by_zero.
(cp_build_unary_op): Add location argument.
(cp_build_modify_expr): Same.
* class.c (build_base_path): Pass location to build_indirect_ref.
* semantics.c (handle_omp_for_class_iterator): Pass elocus to
build_modify_expr.
From-SVN: r140914
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/cp/class.c | 2 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 16 |
4 files changed, 21 insertions, 9 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index eeeb239..dc18acc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,13 @@ +2008-10-06 Aldy Hernandez <aldyh@redhat.com> + + * typeck.c (build_x_indirect_ref): Add location argument. + (cp_build_binary_op): Pass location to warn_for_div_by_zero. + (cp_build_unary_op): Add location argument. + (cp_build_modify_expr): Same. + * class.c (build_base_path): Pass location to build_indirect_ref. + * semantics.c (handle_omp_for_class_iterator): Pass elocus to + build_modify_expr. + 2008-10-05 Dodji Seketeli <dodji@redhat.com> PR c++/37410 diff --git a/gcc/cp/class.c b/gcc/cp/class.c index ab8391b..910dc29 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -299,7 +299,7 @@ build_base_path (enum tree_code code, { expr = build_nop (build_pointer_type (target_type), expr); if (!want_pointer) - expr = build_indirect_ref (expr, NULL, EXPR_LOCATION (expr)); + expr = build_indirect_ref (EXPR_LOCATION (expr), expr, NULL); return expr; } diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 13e9a0f..b1bbb38 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -4109,7 +4109,7 @@ handle_omp_for_class_iterator (int i, location_t locus, tree declv, tree initv, cond = cp_build_binary_op (elocus, TREE_CODE (cond), decl, diff, tf_warning_or_error); - incr = build_modify_expr (decl, PLUS_EXPR, incr); + incr = build_modify_expr (elocus, decl, PLUS_EXPR, incr); orig_body = *body; *body = push_stmt_list (); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 75bcf9c..b115e28 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2405,8 +2405,8 @@ build_x_indirect_ref (tree expr, const char *errorstring, /* Helper function called from c-common. */ tree -build_indirect_ref (tree ptr, const char *errorstring, - location_t loc __attribute__ ((__unused__))) +build_indirect_ref (location_t loc __attribute__ ((__unused__)), + tree ptr, const char *errorstring) { return cp_build_indirect_ref (ptr, errorstring, tf_warning_or_error); } @@ -3349,7 +3349,7 @@ cp_build_binary_op (location_t location, { enum tree_code tcode0 = code0, tcode1 = code1; - warn_for_div_by_zero (op1); + warn_for_div_by_zero (location, op1); if (tcode0 == COMPLEX_TYPE || tcode0 == VECTOR_TYPE) tcode0 = TREE_CODE (TREE_TYPE (TREE_TYPE (op0))); @@ -3385,7 +3385,7 @@ cp_build_binary_op (location_t location, case TRUNC_MOD_EXPR: case FLOOR_MOD_EXPR: - warn_for_div_by_zero (op1); + warn_for_div_by_zero (location, op1); if (code0 == INTEGER_TYPE && code1 == INTEGER_TYPE) { @@ -4642,7 +4642,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, /* Hook for the c-common bits that build a unary op. */ tree -build_unary_op (enum tree_code code, tree xarg, int noconvert) +build_unary_op (location_t location ATTRIBUTE_UNUSED, + enum tree_code code, tree xarg, int noconvert) { return cp_build_unary_op (code, xarg, noconvert, tf_warning_or_error); } @@ -5757,7 +5758,8 @@ cp_build_c_cast (tree type, tree expr, tsubst_flags_t complain) /* For use from the C common bits. */ tree -build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs) +build_modify_expr (location_t location ATTRIBUTE_UNUSED, + tree lhs, enum tree_code modifycode, tree rhs) { return cp_build_modify_expr (lhs, modifycode, rhs, tf_warning_or_error); } @@ -5940,7 +5942,7 @@ cp_build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs, || MAYBE_CLASS_TYPE_P (lhstype))); lhs = stabilize_reference (lhs); - newrhs = cp_build_binary_op (EXPR_LOCATION (lhs), + newrhs = cp_build_binary_op (input_location, modifycode, lhs, rhs, complain); if (newrhs == error_mark_node) |