summaryrefslogtreecommitdiff
path: root/gcc/cp/dump.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-22 18:11:40 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1999-08-22 18:11:40 +0000
commit18830b96b6b20038e42cd18269397b78661f733d (patch)
treea7791d9cc542ab307d92c00dfda3ddcfa88d8be1 /gcc/cp/dump.c
parentad1139b4da1f5e3b321900582cd14dbce8e9f294 (diff)
downloadgcc-18830b96b6b20038e42cd18269397b78661f733d.tar.gz
* cp-tree.def (STMT_EXPR): Fix typo in node name.
* dump.c (dump_next_stmt): New function. (dequeue_and_dump): Use it. * pt.c (tsubst_copy): Make sure to initialize return value for a STMT_EXPR, even when processing_template_decl. * semantics.c (finish_stmt_expr): A statement-expression whose last statement is not an expression-statement has type `void'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/dump.c')
-rw-r--r--gcc/cp/dump.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index d67ab68867d..4ef27e1d696 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -19,9 +19,6 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* TODO: Class types.
- Binfos. */
-
#include "config.h"
#include "system.h"
#include "tree.h"
@@ -90,6 +87,7 @@ static void dump_string PROTO ((dump_info_p, const char *));
static void dump_string_field PROTO ((dump_info_p, const char *, const char *));
static void dump_node PROTO ((tree, FILE *));
static void dump_stmt PROTO ((dump_info_p, tree));
+static void dump_next_stmt PROTO ((dump_info_p, tree));
/* Add T to the end of the queue of nodes to dump. If DUMP_CHILDREN_P
is non-zero, then its children should be dumped as well. Returns
@@ -277,6 +275,16 @@ dump_stmt (di, t)
#define dump_child(field, child) \
queue_and_dump_index (di, field, child, DUMP_CHILDREN)
+/* Dump the next statement after STMT. */
+
+static void
+dump_next_stmt (di, t)
+ dump_info_p di;
+ tree t;
+{
+ dump_child ("next", TREE_CHAIN (t));
+}
+
/* Dump the next node in the queue. */
static void
@@ -642,11 +650,13 @@ dequeue_and_dump (di)
dump_child ("ins", ASM_INPUTS (t));
dump_child ("clbr", ASM_CLOBBERS (t));
}
+ dump_next_stmt (di, t);
break;
case BREAK_STMT:
case CONTINUE_STMT:
dump_stmt (di, t);
+ dump_next_stmt (di, t);
break;
case CASE_LABEL:
@@ -657,18 +667,21 @@ dequeue_and_dump (di)
dump_child ("low", CASE_LOW (t));
dump_child ("high", CASE_HIGH (t));
}
+ dump_next_stmt (di, t);
break;
case COMPOUND_STMT:
dump_stmt (di, t);
if (dump_children_p)
dump_child ("body", COMPOUND_BODY (t));
+ dump_next_stmt (di, t);
break;
case DECL_STMT:
dump_stmt (di, t);
if (dump_children_p)
dump_child ("decl", DECL_STMT_DECL (t));
+ dump_next_stmt (di, t);
break;
case DO_STMT:
@@ -678,12 +691,14 @@ dequeue_and_dump (di)
dump_child ("body", DO_BODY (t));
dump_child ("cond", DO_COND (t));
}
+ dump_next_stmt (di, t);
break;
case EXPR_STMT:
dump_stmt (di, t);
if (dump_children_p)
dump_child ("expr", EXPR_STMT_EXPR (t));
+ dump_next_stmt (di, t);
break;
case FOR_STMT:
@@ -695,12 +710,14 @@ dequeue_and_dump (di)
dump_child ("expr", FOR_EXPR (t));
dump_child ("body", FOR_BODY (t));
}
+ dump_next_stmt (di, t);
break;
case GOTO_STMT:
dump_stmt (di, t);
if (dump_children_p)
dump_child ("dest", GOTO_DESTINATION (t));
+ dump_next_stmt (di, t);
break;
case IF_STMT:
@@ -711,12 +728,14 @@ dequeue_and_dump (di)
dump_child ("then", THEN_CLAUSE (t));
dump_child ("else", ELSE_CLAUSE (t));
}
+ dump_next_stmt (di, t);
break;
case RETURN_STMT:
dump_stmt (di, t);
if (dump_children_p)
dump_child ("expr", RETURN_EXPR (t));
+ dump_next_stmt (di, t);
break;
case SWITCH_STMT:
@@ -726,6 +745,7 @@ dequeue_and_dump (di)
dump_child ("cond", SWITCH_COND (t));
dump_child ("body", SWITCH_BODY (t));
}
+ dump_next_stmt (di, t);
break;
case TRY_BLOCK:
@@ -735,6 +755,7 @@ dequeue_and_dump (di)
dump_child ("body", TRY_STMTS (t));
dump_child ("hdlr", TRY_HANDLERS (t));
}
+ dump_next_stmt (di, t);
break;
case WHILE_STMT:
@@ -744,6 +765,7 @@ dequeue_and_dump (di)
dump_child ("cond", WHILE_COND (t));
dump_child ("body", WHILE_BODY (t));
}
+ dump_next_stmt (di, t);
break;
case INTEGER_CST:
@@ -801,6 +823,11 @@ dequeue_and_dump (di)
dump_child ("elts", TREE_OPERAND (t, 1));
break;
+ case STMT_EXPR:
+ if (dump_children_p)
+ dump_child ("stmt", STMT_EXPR_STMT (t));
+ break;
+
default:
/* There are no additional fields to print. */
break;