From 1cf1742e4834f67465fd29068ec87ac427940a6c Mon Sep 17 00:00:00 2001 From: manu Date: Tue, 7 Jul 2009 21:52:01 +0000 Subject: [PATCH] =?utf8?q?2009-07-07=20=20Manuel=20L=C3=B3pez-Ib=C3=A1?= =?utf8?q?=C3=B1ez=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * tree.c (set_expr_locus): Remove. * tree.h (EXPR_LOCUS,SET_EXPR_LOCUS,set_expr_locus): Remove. * c-typeck.c (c_finish_stmt_expr): Replace EXPR_LOCUS by EXPR_LOCATION. * gimplify.c (internal_get_tmp_var): Likewise. (gimplify_call_expr): Likewise. (gimplify_one_sizepos): Likewise. objc/ * objc-act.c (next_sjlj_build_catch_list): Replace EXPR_LOCUS by EXPR_LOCATION. cp/ * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by EXPR_LOCATION. ada/ * gcc-interface/trans.c (gnat_gimplify_expr): Replace EXPR_LOCUS by EXPR_LOCATION. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149350 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 10 ++++++++++ gcc/ada/ChangeLog | 5 +++++ gcc/ada/gcc-interface/trans.c | 2 +- gcc/c-typeck.c | 2 +- gcc/cp/ChangeLog | 5 +++++ gcc/cp/semantics.c | 2 +- gcc/gimplify.c | 10 +++++----- gcc/objc/ChangeLog | 5 +++++ gcc/objc/objc-act.c | 2 +- gcc/tree.c | 12 ------------ gcc/tree.h | 6 ------ 11 files changed, 34 insertions(+), 27 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 39cc552..8140cc3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2009-07-07 Manuel López-Ibáñez + + * tree.c (set_expr_locus): Remove. + * tree.h (EXPR_LOCUS,SET_EXPR_LOCUS,set_expr_locus): Remove. + * c-typeck.c (c_finish_stmt_expr): Replace EXPR_LOCUS by + EXPR_LOCATION. + * gimplify.c (internal_get_tmp_var): Likewise. + (gimplify_call_expr): Likewise. + (gimplify_one_sizepos): Likewise. + 2009-07-07 Eric Botcazou PR debug/40666 diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 0253a69..082756d 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2009-07-07 Manuel López-Ibáñez + + * gcc-interface/trans.c (gnat_gimplify_expr): Replace EXPR_LOCUS by + EXPR_LOCATION. + 2009-07-07 Gary Dismukes * exp_ch6.adb (Expand_Actuals): Call Add_Call_By_Copy_Code for in out diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index 1008f1a..76200ab 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -5846,7 +5846,7 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p, stmt = gimplify_assign (new_var, op, pre_p); if (EXPR_HAS_LOCATION (op)) - gimple_set_location (stmt, *EXPR_LOCUS (op)); + gimple_set_location (stmt, EXPR_LOCATION (op)); TREE_OPERAND (expr, 0) = new_var; recompute_tree_invariant_for_addr_expr (expr); diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index e86e095..f7df74e 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -8674,7 +8674,7 @@ c_finish_stmt_expr (location_t loc, tree body) val = TREE_OPERAND (val, 0); *last_p = build2 (MODIFY_EXPR, void_type_node, tmp, val); - SET_EXPR_LOCUS (*last_p, EXPR_LOCUS (last)); + SET_EXPR_LOCATION (*last_p, EXPR_LOCATION (last)); { tree t = build4 (TARGET_EXPR, type, tmp, body, NULL_TREE, NULL_TREE); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a0eedeb..aa28747 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2009-07-07 Manuel López-Ibáñez + + * semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by + EXPR_LOCATION. + 2009-07-07 Jason Merrill PR c++/37816 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 1b96ac2..aa52a36 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -3334,7 +3334,7 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data) else init = build_empty_stmt (EXPR_LOCATION (*tp)); DECL_INITIAL (dp->var) = NULL_TREE; - SET_EXPR_LOCUS (init, EXPR_LOCUS (*tp)); + SET_EXPR_LOCATION (init, EXPR_LOCATION (*tp)); *tp = init; } /* And replace all uses of the NRV with the RESULT_DECL. */ diff --git a/gcc/gimplify.c b/gcc/gimplify.c index c5fb185..032228d 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -610,7 +610,7 @@ internal_get_tmp_var (tree val, gimple_seq *pre_p, gimple_seq *post_p, mod = build2 (INIT_EXPR, TREE_TYPE (t), t, unshare_expr (val)); if (EXPR_HAS_LOCATION (val)) - SET_EXPR_LOCUS (mod, EXPR_LOCUS (val)); + SET_EXPR_LOCATION (mod, EXPR_LOCATION (val)); else SET_EXPR_LOCATION (mod, input_location); @@ -814,7 +814,7 @@ gimple_set_do_not_emit_location (gimple g) gimple_set_plf (g, GF_PLF_1, true); } -/* Set the location for gimple statement GS to LOCUS. */ +/* Set the location for gimple statement GS to LOCATION. */ static void annotate_one_with_location (gimple gs, location_t location) @@ -854,7 +854,7 @@ annotate_all_with_location_after (gimple_seq seq, gimple_stmt_iterator gsi, } -/* Set the location for all the statements in a sequence STMT_P to LOCUS. */ +/* Set the location for all the statements in a sequence STMT_P to LOCATION. */ void annotate_all_with_location (gimple_seq stmt_p, location_t location) @@ -2375,7 +2375,7 @@ gimplify_call_expr (tree *expr_p, gimple_seq *pre_p, bool want_value) = CALL_EXPR_RETURN_SLOT_OPT (call); CALL_FROM_THUNK_P (*expr_p) = CALL_FROM_THUNK_P (call); CALL_CANNOT_INLINE_P (*expr_p) = CALL_CANNOT_INLINE_P (call); - SET_EXPR_LOCUS (*expr_p, EXPR_LOCUS (call)); + SET_EXPR_LOCATION (*expr_p, EXPR_LOCATION (call)); TREE_BLOCK (*expr_p) = TREE_BLOCK (call); /* Set CALL_EXPR_VA_ARG_PACK. */ @@ -7360,7 +7360,7 @@ gimplify_one_sizepos (tree *expr_p, gimple_seq *stmt_p) tmp = build1 (NOP_EXPR, type, expr); stmt = gimplify_assign (*expr_p, tmp, stmt_p); if (EXPR_HAS_LOCATION (expr)) - gimple_set_location (stmt, *EXPR_LOCUS (expr)); + gimple_set_location (stmt, EXPR_LOCATION (expr)); else gimple_set_location (stmt, input_location); } diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 2268413..00475c1 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,5 +1,10 @@ 2009-07-07 Manuel López-Ibáñez + * objc-act.c (next_sjlj_build_catch_list): Replace EXPR_LOCUS by + EXPR_LOCATION. + +2009-07-07 Manuel López-Ibáñez + * objc-act.c: Replace %J by an explicit location. Update all calls. diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 917caf1..23aae28 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -3669,7 +3669,7 @@ next_sjlj_build_catch_list (void) cond = c_common_truthvalue_conversion (input_location, t); } t = build3 (COND_EXPR, void_type_node, cond, body, NULL); - SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt)); + SET_EXPR_LOCATION (t, EXPR_LOCATION (stmt)); *last = t; last = &COND_EXPR_ELSE (t); diff --git a/gcc/tree.c b/gcc/tree.c index 2718667..7c5f154 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3940,18 +3940,6 @@ expand_location (source_location loc) } -/* Source location accessor functions. */ - - -void -set_expr_locus (tree node, source_location *loc) -{ - if (loc == NULL) - EXPR_CHECK (node)->exp.locus = UNKNOWN_LOCATION; - else - EXPR_CHECK (node)->exp.locus = *loc; -} - /* Like SET_EXPR_LOCATION, but make sure the tree can have a location. LOC is the location to use in tree T. */ diff --git a/gcc/tree.h b/gcc/tree.h index e2eb76e..cc00c6d 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -1540,10 +1540,6 @@ struct GTY(()) tree_constructor { #define EXPR_LOCATION(NODE) (EXPR_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION) #define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS) #define EXPR_HAS_LOCATION(NODE) (EXPR_LOCATION (NODE) != UNKNOWN_LOCATION) -#define EXPR_LOCUS(NODE) (EXPR_P (NODE) \ - ? CONST_CAST (source_location *, &(NODE)->exp.locus) \ - : (source_location *) NULL) -#define SET_EXPR_LOCUS(NODE, FROM) set_expr_locus ((NODE), (FROM)) #define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus) #define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus) @@ -4858,8 +4854,6 @@ extern HOST_WIDEST_INT widest_int_cst_value (const_tree); extern bool fields_compatible_p (const_tree, const_tree); extern tree find_compatible_field (tree, tree); -extern void set_expr_locus (tree, source_location *); - extern tree *tree_block (tree); extern location_t *block_nonartificial_location (tree); extern location_t tree_nonartificial_location (tree); -- 2.7.4