This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH for more tree documentation/dumping
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++ PATCH for more tree documentation/dumping
- From: Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 05 Oct 1999 17:13:35 -0700
- Organization: CodeSourcery, LLC
This patch dumps and documents BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
1999-10-05 Mark Mitchell <mark@codesourcery.com>
* ir.texi: Document BIND_EXPR, LOOP_EXPR, and EXIT_EXPR.
* dump.c (dequeue_and_dump): Dump them.
Index: dump.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/dump.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -c -p -r1.18 -r1.19
*** dump.c 1999/10/03 18:57:37 1.18
--- dump.c 1999/10/05 23:59:27 1.19
*************** dequeue_and_dump (di)
*** 903,908 ****
--- 903,926 ----
dump_child ("stmt", STMT_EXPR_STMT (t));
break;
+ case BIND_EXPR:
+ if (dump_children_p)
+ {
+ dump_child ("vars", TREE_OPERAND (t, 0));
+ dump_child ("body", TREE_OPERAND (t, 1));
+ }
+ break;
+
+ case LOOP_EXPR:
+ if (dump_children_p)
+ dump_child ("body", TREE_OPERAND (t, 0));
+ break;
+
+ case EXIT_EXPR:
+ if (dump_children_p)
+ dump_child ("cond", TREE_OPERAND (t, 0));
+ break;
+
case TARGET_EXPR:
if (dump_children_p)
{
Index: ir.texi
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/ir.texi,v
retrieving revision 1.13
retrieving revision 1.15
diff -c -p -r1.13 -r1.15
*** ir.texi 1999/10/03 16:04:29 1.13
--- ir.texi 1999/10/05 23:59:24 1.15
*************** The @code{WHILE_BODY} is the body of the
*** 1466,1471 ****
--- 1466,1474 ----
@tindex CALL_EXPR
@tindex CONSTRUCTOR
@tindex STMT_EXPR
+ @tindex BIND_EXPR
+ @tindex LOOP_EXPR
+ @tindex EXIT_EXPR
@tindex ARRAY_REF
The internal representation for expressions is for the most part quite
*************** such an expression. The @code{STMT_EXPR
*** 1816,1821 ****
--- 1819,1842 ----
contained in the expression; this is always a @code{COMPOUND_STMT}. The
value of the expression is the value of the last sub-statement in the
@code{COMPOUND_STMT}.
+
+ @item BIND_EXPR
+ These nodes represent local blocks. The first operand is a list of
+ temporary variables, connected via their @code{TREE_CHAIN} field. These
+ will never require cleanups. The scope of these variables is just the
+ body of the @code{BIND_EXPR}. The body of the @code{BIND_EXPR} is the
+ second operand.
+
+ @item LOOP_EXPR
+ These nodes represent ``infinite'' loops. The @code{LOOP_EXPR_BODY}
+ represents the body of the loop. It should be executed forever, unless
+ an @code{EXIT_EXPR} is encountered.
+
+ @item EXIT_EXPR
+ These nodes represent conditional exits from the nearest enclosing
+ @code{LOOP_EXPR}. The single operand is the condition; if it is
+ non-zero, then the loop should be exited. An @code{EXIT_EXPR} will only
+ appear within a @code{LOOP_EXPR}.
@item CONSTRUCTOR
These nodes represent the brace-enclosed initializers for a structure or