Patchwork fix DO_STMT comment in cp-tree.def.

login
register
mail settings
Submitter Tom de Vries
Date Nov. 22, 2011, 2:39 p.m.
Message ID <4ECBB410.8020906@mentor.com>
Download mbox | patch
Permalink /patch/127089/
State New
Headers show

Comments

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

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