aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-06-21 16:30:30 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-06-21 16:30:30 -0700
commit5088b05874bc5a93099751efb19abe213ce2d0d1 (patch)
tree549a437788493737d07ebf98e175601b039ef1a9 /gcc/cp
parent0b4da8a182e81009fbd65d56451be31790132471 (diff)
downloadgcc-5088b05874bc5a93099751efb19abe213ce2d0d1.zip
gcc-5088b05874bc5a93099751efb19abe213ce2d0d1.tar.gz
gcc-5088b05874bc5a93099751efb19abe213ce2d0d1.tar.bz2
c-common.def (RETURN_STMT): Remove.
* c-common.def (RETURN_STMT): Remove. * c-common.h (RETURN_STMT_EXPR): Remove. (c_expand_return, build_return_stmt): Remove. (c_common_stmt_codes): Remove RETURN_STMT. * c-dump.c (dump_next_stmt): Remove. (c_dump_tree): Remove RETURN_STMT. * c-decl.c (finish_function): Use c_finish_return. * c-parse.in (stmt): Likewise. * c-gimplify.c (gimplify_return_stmt): Remove. (c_gimplify_expr): Remove RETURN_STMT. * c-pretty-print.c (pp_c_statement): Likewise. * c-semantics.c (build_return_stmt): Remove. * c-tree.h (c_finish_return): Declare. * c-typeck.c (c_finish_return): Rename from c_expand_return. Return void. Build RETURN_EXPR directly. * tree-dump.h (dump_next_stmt): Remove. cp/ * dump.c (cp_dump_tree): Don't use dump_next_stmt. * parser.c (cp_parser_jump_statement): Update commentary. * pt.c (tsubst_expr): Use RETURN_EXPR. * semantics.c (finish_return_stmt): Likewise. (finalize_nrv_r): Likewise. * typeck.c, typeck2.c: Update file start commentary. From-SVN: r83461
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog9
-rw-r--r--gcc/cp/cp-gimplify.c2
-rw-r--r--gcc/cp/dump.c7
-rw-r--r--gcc/cp/parser.c2
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/cp/semantics.c12
-rw-r--r--gcc/cp/typeck.c6
-rw-r--r--gcc/cp/typeck2.c6
8 files changed, 21 insertions, 27 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 679289a..0291057 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,14 @@
2004-06-21 Richard Henderson <rth@redhat.com>
+ * dump.c (cp_dump_tree): Don't use dump_next_stmt.
+ * parser.c (cp_parser_jump_statement): Update commentary.
+ * pt.c (tsubst_expr): Use RETURN_EXPR.
+ * semantics.c (finish_return_stmt): Likewise.
+ (finalize_nrv_r): Likewise.
+ * typeck.c, typeck2.c: Update file start commentary.
+
+2004-06-21 Richard Henderson <rth@redhat.com>
+
* semantics.c (finish_expr_stmt): Call verify_sequence_points.
2004-06-20 Richard Henderson <rth@redhat.com>
diff --git a/gcc/cp/cp-gimplify.c b/gcc/cp/cp-gimplify.c
index 8bdf5f4..f9b2364 100644
--- a/gcc/cp/cp-gimplify.c
+++ b/gcc/cp/cp-gimplify.c
@@ -1,6 +1,6 @@
/* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c.
- Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@redhat.com>
This file is part of GCC.
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index fd0a847..f765c32 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -366,14 +366,12 @@ cp_dump_tree (void* dump_info, tree t)
dump_string (di, "cleanup");
dump_child ("body", TRY_STMTS (t));
dump_child ("hdlr", TRY_HANDLERS (t));
- dump_next_stmt (di, t);
break;
case EH_SPEC_BLOCK:
dump_stmt (di, t);
dump_child ("body", EH_SPEC_STMTS (t));
dump_child ("raises", EH_SPEC_RAISES (t));
- dump_next_stmt (di, t);
break;
case PTRMEM_CST:
@@ -397,19 +395,16 @@ cp_dump_tree (void* dump_info, tree t)
dump_stmt (di, t);
dump_child ("parm", HANDLER_PARMS (t));
dump_child ("body", HANDLER_BODY (t));
- dump_next_stmt (di, t);
break;
case MUST_NOT_THROW_EXPR:
dump_stmt (di, t);
dump_child ("body", TREE_OPERAND (t, 0));
- dump_next_stmt (di, t);
break;
case USING_STMT:
dump_stmt (di, t);
dump_child ("nmsp", USING_STMT_NAMESPACE (t));
- dump_next_stmt (di, t);
break;
case CLEANUP_STMT:
@@ -417,7 +412,6 @@ cp_dump_tree (void* dump_info, tree t)
dump_child ("decl", CLEANUP_DECL (t));
dump_child ("expr", CLEANUP_EXPR (t));
dump_child ("body", CLEANUP_BODY (t));
- dump_next_stmt (di, t);
break;
case IF_STMT:
@@ -425,7 +419,6 @@ cp_dump_tree (void* dump_info, tree t)
dump_child ("cond", IF_COND (t));
dump_child ("then", THEN_CLAUSE (t));
dump_child ("else", ELSE_CLAUSE (t));
- dump_next_stmt (di, t);
break;
default:
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 91512de..bd6abe8 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6241,7 +6241,7 @@ cp_parser_for_init_statement (cp_parser* parser)
jump-statement:
goto * expression ;
- Returns the new BREAK_STMT, CONTINUE_STMT, RETURN_STMT, or GOTO_EXPR. */
+ Returns the new BREAK_STMT, CONTINUE_STMT, RETURN_EXPR, or GOTO_EXPR. */
static tree
cp_parser_jump_statement (cp_parser* parser)
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index de4ab28..f8e259c 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7773,8 +7773,8 @@ tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
(TREE_OPERAND (t, 0), args));
break;
- case RETURN_STMT:
- finish_return_stmt (tsubst_expr (RETURN_STMT_EXPR (t),
+ case RETURN_EXPR:
+ finish_return_stmt (tsubst_expr (TREE_OPERAND (t, 0),
args, complain, in_decl));
break;
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 826ac68..0da9494 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -3,8 +3,8 @@
building RTL. These routines are used both during actual parsing
and during the instantiation of template functions.
- Copyright (C) 1998, 1999, 2000, 2001, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Written by Mark Mitchell (mmitchell@usa.net) based on code found
formerly in parse.y and pt.c.
@@ -667,7 +667,7 @@ finish_return_stmt (tree expr)
}
}
- r = build_stmt (RETURN_STMT, expr);
+ r = build_stmt (RETURN_EXPR, expr);
r = maybe_cleanup_point_expr (r);
r = add_stmt (r);
finish_stmt ();
@@ -3009,8 +3009,8 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data)
/* Change all returns to just refer to the RESULT_DECL; this is a nop,
but differs from using NULL_TREE in that it indicates that we care
about the value of the RESULT_DECL. */
- else if (TREE_CODE (*tp) == RETURN_STMT)
- RETURN_STMT_EXPR (*tp) = dp->result;
+ else if (TREE_CODE (*tp) == RETURN_EXPR)
+ TREE_OPERAND (*tp, 0) = dp->result;
/* Change all cleanups for the NRV to only run when an exception is
thrown. */
else if (TREE_CODE (*tp) == CLEANUP_STMT
@@ -3052,7 +3052,7 @@ finalize_nrv_r (tree* tp, int* walk_subtrees, void* data)
}
/* Called from finish_function to implement the named return value
- optimization by overriding all the RETURN_STMTs and pertinent
+ optimization by overriding all the RETURN_EXPRs and pertinent
CLEANUP_STMTs and replacing all occurrences of VAR with RESULT, the
RESULT_DECL for the function. */
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 9504083..bdf7377 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -24,11 +24,7 @@ Boston, MA 02111-1307, USA. */
/* This file is part of the C++ front end.
It contains routines to build C++ expressions given their operands,
including computing the types of the result, C and C++ specific error
- checks, and some optimization.
-
- There are also routines to build RETURN_STMT nodes and CASE_STMT nodes,
- and to process initializations in declarations (since they work
- like a strange sort of assignment). */
+ checks, and some optimization. */
#include "config.h"
#include "system.h"
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 9b998ea..9ea4f55 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -26,11 +26,7 @@ Boston, MA 02111-1307, USA. */
/* This file is part of the C++ front end.
It contains routines to build C++ expressions given their operands,
including computing the types of the result, C and C++ specific error
- checks, and some optimization.
-
- There are also routines to build RETURN_STMT nodes and CASE_STMT nodes,
- and to process initializations in declarations (since they work
- like a strange sort of assignment). */
+ checks, and some optimization. */
#include "config.h"
#include "system.h"