From 5e278028ed86b38bc0b649aa6e351d35c6ad539c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Manuel=20L=C3=B3pez-Ib=C3=A1=C3=B1ez?= <manu@gcc.gnu.org>
Date: Tue, 7 Jul 2009 21:52:01 +0000
Subject: [PATCH] tree.c (set_expr_locus): Remove.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* 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.

From-SVN: r149350
---
 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 39cc5522a9c3..8140cc3c4398 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	* 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  <ebotcazou@adacore.com>
 
 	PR debug/40666
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 0253a696b25f..082756dfd8b2 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	* gcc-interface/trans.c (gnat_gimplify_expr):  Replace EXPR_LOCUS by
+	EXPR_LOCATION.
+
 2009-07-07  Gary Dismukes  <dismukes@adacore.com>
 
 	* 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 1008f1a4d175..76200ab34a9d 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 e86e0951a5db..f7df74e9eefa 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 a0eedebf113f..aa28747c8569 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	* semantics.c (finalize_nrv_r): Replace EXPR_LOCUS by
+	EXPR_LOCATION.
+	
 2009-07-07  Jason Merrill  <jason@redhat.com>
 
 	PR c++/37816
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 1b96ac265a28..aa52a362fb79 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 c5fb18569baa..032228d2a28d 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 2268413b508e..00475c1ac1e4 100644
--- a/gcc/objc/ChangeLog
+++ b/gcc/objc/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
+
+	* objc-act.c (next_sjlj_build_catch_list): Replace EXPR_LOCUS by
+	EXPR_LOCATION.
+	
 2009-07-07  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
 	* objc-act.c: Replace %J by an explicit location. Update all
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 917caf1fbe2e..23aae280e6b8 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 2718667665ba..7c5f154ad389 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 e2eb76e80210..cc00c6d31fee 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);
-- 
GitLab