This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH to rename RETURN_EXPR() to RETURN_STMT_EXPR()


There's already a RETURN_EXPR tree code, so we shouldn't have a
function-like macro with the same name.

Tested i686-pc-linux-gnu.

2002-08-22  Jason Merrill  <jason@redhat.com>

	* c-common.h (RETURN_STMT_EXPR): Rename from RETURN_EXPR.
	* c-common.def: Adjust.
	* c-dump.c (c_dump_tree): Adjust.
	* c-semantics.c (genrtl_return_stmt): Adjust.
	* c-pretty-print.c (pp_c_statement): Adjust.
	* tree-inline.c (copy_body_r): Adjust.
  
2002-08-22  Jason Merrill  <jason@redhat.com>

	* pt.c (tsubst_expr): RETURN_EXPR is now RETURN_STMT_EXPR.
	* semantics.c (nullify_returns_r): Likewise.

*** ./cp/pt.c.~1~	Thu Aug 22 16:28:33 2002
--- ./cp/pt.c	Thu Aug 22 16:21:13 2002
*************** tsubst_expr (t, args, complain, in_decl)
*** 7382,7388 ****
  
      case RETURN_STMT:
        prep_stmt (t);
!       finish_return_stmt (tsubst_expr (RETURN_EXPR (t),
  				       args, complain, in_decl));
        break;
  
--- 7382,7388 ----
  
      case RETURN_STMT:
        prep_stmt (t);
!       finish_return_stmt (tsubst_expr (RETURN_STMT_EXPR (t),
  				       args, complain, in_decl));
        break;
  
*** ./cp/semantics.c.~1~	Thu Aug 22 16:28:33 2002
--- ./cp/semantics.c	Thu Aug 22 16:21:14 2002
*************** nullify_returns_r (tp, walk_subtrees, da
*** 2506,2512 ****
    if (TYPE_P (*tp))
      *walk_subtrees = 0;
    else if (TREE_CODE (*tp) == RETURN_STMT)
!     RETURN_EXPR (*tp) = NULL_TREE;
    else if (TREE_CODE (*tp) == CLEANUP_STMT
  	   && CLEANUP_DECL (*tp) == nrv)
      CLEANUP_EH_ONLY (*tp) = 1;
--- 2506,2512 ----
    if (TYPE_P (*tp))
      *walk_subtrees = 0;
    else if (TREE_CODE (*tp) == RETURN_STMT)
!     RETURN_STMT_EXPR (*tp) = NULL_TREE;
    else if (TREE_CODE (*tp) == CLEANUP_STMT
  	   && CLEANUP_DECL (*tp) == nrv)
      CLEANUP_EH_ONLY (*tp) = 1;
*** ./c-common.h.~1~	Thu Aug 22 16:28:32 2002
--- ./c-common.h	Thu Aug 22 16:21:14 2002
*************** extern tree strip_array_types           
*** 945,951 ****
  /* RETURN_STMT accessors. These give the expression associated with a
     return statement, and whether it should be ignored when expanding
     (as opposed to inlining).  */
! #define RETURN_EXPR(NODE)       TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
  
  /* EXPR_STMT accessor. This gives the expression associated with an
     expression statement.  */
--- 945,951 ----
  /* RETURN_STMT accessors. These give the expression associated with a
     return statement, and whether it should be ignored when expanding
     (as opposed to inlining).  */
! #define RETURN_STMT_EXPR(NODE)  TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
  
  /* EXPR_STMT accessor. This gives the expression associated with an
     expression statement.  */
*** ./c-dump.c.~1~	Thu Aug 22 16:28:32 2002
--- ./c-dump.c	Thu Aug 22 16:21:14 2002
*************** c_dump_tree (dump_info, t)
*** 153,159 ****
  
      case RETURN_STMT:
        dump_stmt (di, t);
!       dump_child ("expr", RETURN_EXPR (t));
        dump_next_stmt (di, t);
        break;
  
--- 153,159 ----
  
      case RETURN_STMT:
        dump_stmt (di, t);
!       dump_child ("expr", RETURN_STMT_EXPR (t));
        dump_next_stmt (di, t);
        break;
  
*** ./c-common.def.~1~	Thu Aug 22 16:28:32 2002
--- ./c-common.def	Thu Aug 22 16:20:57 2002
*************** DEFTREECODE (WHILE_STMT, "while_stmt", '
*** 61,67 ****
  DEFTREECODE (DO_STMT, "do_stmt", 'e', 2)
  
  /* Used to represent a 'return' statement. The operand is
!    RETURN_EXPR. */
  DEFTREECODE (RETURN_STMT, "return_stmt", 'e', 1)
  
  /* Used to represent a 'break' statement. */
--- 61,67 ----
  DEFTREECODE (DO_STMT, "do_stmt", 'e', 2)
  
  /* Used to represent a 'return' statement. The operand is
!    RETURN_STMT_EXPR. */
  DEFTREECODE (RETURN_STMT, "return_stmt", 'e', 1)
  
  /* Used to represent a 'break' statement. */
*** ./c-pretty-print.c.~1~	Thu Aug 22 16:28:32 2002
--- ./c-pretty-print.c	Thu Aug 22 16:21:14 2002
*************** pp_c_statement (ppi, stmt)
*** 1384,1390 ****
      case GOTO_STMT:
        {
  	tree e = code == RETURN_STMT 
! 	  ? RETURN_EXPR (stmt)
  	  : GOTO_DESTINATION (stmt);
  
  	pp_newline (ppi);
--- 1384,1390 ----
      case GOTO_STMT:
        {
  	tree e = code == RETURN_STMT 
! 	  ? RETURN_STMT_EXPR (stmt)
  	  : GOTO_DESTINATION (stmt);
  
  	pp_newline (ppi);
*** ./c-semantics.c.~1~	Thu Aug 22 16:28:32 2002
--- ./c-semantics.c	Thu Aug 22 16:21:14 2002
*************** genrtl_return_stmt (stmt)
*** 487,493 ****
  {
    tree expr;
  
!   expr = RETURN_EXPR (stmt);
  
    emit_line_note (input_filename, lineno);
    if (!expr)
--- 487,493 ----
  {
    tree expr;
  
!   expr = RETURN_STMT_EXPR (stmt);
  
    emit_line_note (input_filename, lineno);
    if (!expr)
*** ./tree-inline.c.~1~	Thu Aug 22 16:28:32 2002
--- ./tree-inline.c	Thu Aug 22 16:21:14 2002
*************** copy_body_r (tp, walk_subtrees, data)
*** 442,451 ****
  	 assignment into the equivalent of the original
  	 RESULT_DECL.  */
  #ifndef INLINER_FOR_JAVA
!       if (RETURN_EXPR (return_stmt))
  	{
  	  *tp = build_stmt (EXPR_STMT,
! 			    RETURN_EXPR (return_stmt));
  	  STMT_IS_FULL_EXPR_P (*tp) = 1;
  	  /* And then jump to the end of the function.  */
  	  TREE_CHAIN (*tp) = goto_stmt;
--- 442,451 ----
  	 assignment into the equivalent of the original
  	 RESULT_DECL.  */
  #ifndef INLINER_FOR_JAVA
!       if (RETURN_STMT_EXPR (return_stmt))
  	{
  	  *tp = build_stmt (EXPR_STMT,
! 			    RETURN_STMT_EXPR (return_stmt));
  	  STMT_IS_FULL_EXPR_P (*tp) = 1;
  	  /* And then jump to the end of the function.  */
  	  TREE_CHAIN (*tp) = goto_stmt;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]