C++ PATCH for dump/doc of SAVE_EXPR

Mark Mitchell mark@codesourcery.com
Wed Oct 27 11:19:00 GMT 1999


Minor enhancements to the whole-file tree dumper.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

I1999-10-27  Mark Mitchell  <mark@codesourcery.com>

	* dump.c (dequeue_and_dump): Dump HANDLERs and SAVE_EXPRs.  Dump
	CLEANUP_P for a TRY_BLOCK.
	* ir.texi: Document SAVE_EXPR.

index: dump.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/dump.c,v
retrieving revision 1.24
diff -c -p -r1.24 dump.c
*** dump.c	1999/10/22 01:40:30	1.24
--- dump.c	1999/10/27 18:15:29
*************** dequeue_and_dump (di)
*** 678,683 ****
--- 678,689 ----
        dump_next_stmt (di, t);
        break;
  
+     case HANDLER:
+       dump_stmt (di, t);
+       dump_child ("body", HANDLER_BODY (t));
+       dump_next_stmt (di, t);
+       break;
+ 
      case IF_STMT:
        dump_stmt (di, t);
        dump_child ("cond", IF_COND (t));
*************** dequeue_and_dump (di)
*** 707,712 ****
--- 713,720 ----
  
      case TRY_BLOCK:
        dump_stmt (di, t);
+       if (CLEANUP_P (t))
+ 	dump_string (di, "cleanup");
        dump_child ("body", TRY_STMTS (t));
        dump_child ("hdlr", TRY_HANDLERS (t));
        dump_next_stmt (di, t);
*************** dequeue_and_dump (di)
*** 770,775 ****
--- 778,784 ----
      case INDIRECT_REF:
      case THROW_EXPR:
      case CLEANUP_POINT_EXPR:
+     case SAVE_EXPR:
        /* These nodes are unary, but do not have code class `1'.  */
        dump_child ("op 0", TREE_OPERAND (t, 0));
        break;
Index: ir.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/ir.texi,v
retrieving revision 1.19
diff -c -p -r1.19 ir.texi
*** ir.texi	1999/10/21 07:10:36	1.19
--- ir.texi	1999/10/27 18:15:31
*************** storage is initialized to zero.
*** 1897,1903 ****
  
  @item SAVE_EXPR
  
! FIXME: Describe.
  
  @item TARGET_EXPR
  A @code{TARGET_EXPR} represents a temporary object.  The first operand
--- 1897,1909 ----
  
  @item SAVE_EXPR
  
! A @code{SAVE_EXPR} represents an expression (possibly involving
! side-effects) that is used more than once.  The side-effects should
! occur only the first time the expression is evaluated.  Subsequent uses
! should juse reuse the computed value.  The first operand to the
! @code{SAVE_EXPR} is the expression to evaluate.  The side-effects should
! be executed where the @code{SAVE_EXPR} is first encountered in a
! depth-first preorder traversal of the expression tree.
  
  @item TARGET_EXPR
  A @code{TARGET_EXPR} represents a temporary object.  The first operand


More information about the Gcc-patches mailing list