OSDN Git Service

PR c++/15815
[pf3gnuchains/gcc-fork.git] / gcc / c-semantics.c
index bda5161..f164c95 100644 (file)
@@ -128,10 +128,12 @@ pop_stmt_list (tree t)
 tree
 add_stmt (tree t)
 {
-  if (EXPR_P (t) || STATEMENT_CODE_P (TREE_CODE (t)))
+  enum tree_code code = TREE_CODE (t);
+
+  if ((EXPR_P (t) || STATEMENT_CODE_P (code)) && code != LABEL_EXPR)
     {
-      if (!EXPR_LOCUS (t))
-       annotate_with_locus (t, input_location);
+      if (!EXPR_HAS_LOCATION (t))
+       SET_EXPR_LOCATION (t, input_location);
 
       /* When we expand a statement-tree, we must know whether or not the
         statements are full-expressions.  We record that fact here.  */
@@ -147,7 +149,7 @@ add_stmt (tree t)
 
 /* Build a generic statement based on the given type of node and
    arguments. Similar to `build_nt', except that we set
-   EXPR_LOCUS to be the current source location.  */
+   EXPR_LOCATION to be the current source location.  */
 /* ??? This should be obsolete with the lineno_stmt productions
    in the grammar.  */
 
@@ -164,7 +166,7 @@ build_stmt (enum tree_code code, ...)
   ret = make_node (code);
   TREE_TYPE (ret) = void_type_node;
   length = TREE_CODE_LENGTH (code);
-  annotate_with_locus (ret, input_location);
+  SET_EXPR_LOCATION (ret, input_location);
 
   /* Most statements have implicit side effects all on their own, 
      such as control transfer.  For those that do, we'll compute
@@ -247,14 +249,6 @@ emit_local_var (tree decl)
     }
 }
 
-/* Build the node for a return statement and return it.  */
-
-tree
-build_return_stmt (tree expr)
-{
-  return (build_stmt (RETURN_STMT, expr));
-}
-
 /* Build a break statement node and return it.  */
 
 tree