Richard,
The comment at DO_STMT led me to believe that DO_BODY was the first operand.
cp-tree.def:
...
./* Used to represent a 'do' statement. The operands are DO_BODY and
DO_COND, respectively. */
DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2)
..
However, in cp-tree.h we see that DO_BODY is actually the second operand:
...
/* DO_STMT accessors. These give access to the condition of the do
statement and the body of the do statement, respectively. */
#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0)
#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1)
...
The patch fixes the comment.
OK for trunk?
Thanks,
- Tom
2011-11-22 Tom de Vries <[email protected]>
* cp-tree.def (DO_STMT): Fix comment.
Index: gcc/cp/cp-tree.def
===================================================================
--- gcc/cp/cp-tree.def (revision 181172)
+++ gcc/cp/cp-tree.def (working copy)
@@ -308,8 +308,8 @@ DEFTREECODE (RANGE_FOR_STMT, "range_for_
and WHILE_BODY, respectively. */
DEFTREECODE (WHILE_STMT, "while_stmt", tcc_statement, 2)
-/* Used to represent a 'do' statement. The operands are DO_BODY and
- DO_COND, respectively. */
+/* Used to represent a 'do' statement. The operands are DO_COND and
+ DO_BODY, respectively. */
DEFTREECODE (DO_STMT, "do_stmt", tcc_statement, 2)
/* Used to represent a 'break' statement. */