diff mbox

fix DO_STMT comment in cp-tree.def.

Message ID 4ECBB410.8020906@mentor.com
State New
Headers show

Commit Message

Tom de Vries Nov. 22, 2011, 2:39 p.m. UTC
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  <tom@codesourcery.com>

	* cp-tree.def (DO_STMT): Fix comment.
diff mbox

Patch

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.  */