public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c
@ 2012-04-18 15:32 Steven Bosscher
  2012-04-18 20:56 ` Tom Tromey
  2016-06-13 16:13 ` Fix CASE_CHAIN typos (was: [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c) Thomas Schwinge
  0 siblings, 2 replies; 3+ messages in thread
From: Steven Bosscher @ 2012-04-18 15:32 UTC (permalink / raw)
  To: GCC Patches

Subject says all. Will commit as obvious.

        * tree.def (CASE_LABEL_EXPR): Fix documentation, mention all operands.
        * tree-cfg.c (edge_to_cases): Fix documentation.

Index: tree.def
===================================================================
--- tree.def    (revision 186526)
+++ tree.def    (working copy)
@@ -876,10 +876,16 @@ DEFTREECODE (LOOP_EXPR, "loop_expr", tcc_statement
      of all the cases.  */
 DEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statement, 3)

-/* Used to represent a case label. The operands are CASE_LOW and
-   CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a
-   'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case
-   label.  CASE_LABEL is the corresponding LABEL_DECL.  */
+/* Used to represent a case label.
+
+   Operand 0 is CASE_LOW.  It may be NULL_TREE, in which case the label
+     is a 'default' label.
+   Operand 1 is CASE_HIGH.  If it is NULL_TREE, the label is a simple
+     (one-value) case label.  If it is non-NULL_TREE, the case is a range.
+   Operand 2 is CASE_LABEL, which is is the corresponding LABEL_DECL.
+   Operand 4 is CASE_CHAIN.  This operand is only used in tree-cfg.c to
+     speed up the lookup of case labels which use a particular edge in
+     the control flow graph.  */
 DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4)

 /* Used to represent an inline assembly statement.  ASM_STRING returns a
Index: tree-cfg.c
===================================================================
--- tree-cfg.c  (revision 186526)
+++ tree-cfg.c  (working copy)
@@ -56,7 +56,7 @@ static const int initial_cfg_capacity = 20;

 /* This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs
    which use a particular edge.  The CASE_LABEL_EXPRs are chained together
-   via their TREE_CHAIN field, which we clear after we're done with the
+   via their CASE_CHAIN field, which we clear after we're done with the
    hash table to prevent problems with duplication of GIMPLE_SWITCHes.

    Access to this list of CASE_LABEL_EXPRs allows us to efficiently

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c
  2012-04-18 15:32 [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c Steven Bosscher
@ 2012-04-18 20:56 ` Tom Tromey
  2016-06-13 16:13 ` Fix CASE_CHAIN typos (was: [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c) Thomas Schwinge
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2012-04-18 20:56 UTC (permalink / raw)
  To: Steven Bosscher; +Cc: GCC Patches

>>>>> "Steven" == Steven Bosscher <stevenb.gcc@gmail.com> writes:

Steven> Subject says all. Will commit as obvious.
Steven>         * tree.def (CASE_LABEL_EXPR): Fix documentation, mention all operands.

Thank you.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Fix CASE_CHAIN typos (was: [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c)
  2012-04-18 15:32 [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c Steven Bosscher
  2012-04-18 20:56 ` Tom Tromey
@ 2016-06-13 16:13 ` Thomas Schwinge
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Schwinge @ 2016-06-13 16:13 UTC (permalink / raw)
  To: GCC Patches; +Cc: Steven Bosscher

[-- Attachment #1: Type: text/plain, Size: 4454 bytes --]

Hi!

On Wed, 18 Apr 2012 17:32:08 +0200, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
> Subject says all. Will commit as obvious.
> 
>         * tree.def (CASE_LABEL_EXPR): Fix documentation, mention all operands.
>         * tree-cfg.c (edge_to_cases): Fix documentation.

> --- tree.def    (revision 186526)
> +++ tree.def    (working copy)
> @@ -876,10 +876,16 @@ DEFTREECODE (LOOP_EXPR, "loop_expr", tcc_statement
>       of all the cases.  */
>  DEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statement, 3)
> 
> -/* Used to represent a case label. The operands are CASE_LOW and
> -   CASE_HIGH, respectively. If CASE_LOW is NULL_TREE, the label is a
> -   'default' label. If CASE_HIGH is NULL_TREE, the label is a normal case
> -   label.  CASE_LABEL is the corresponding LABEL_DECL.  */
> +/* Used to represent a case label.
> +
> +   Operand 0 is CASE_LOW.  It may be NULL_TREE, in which case the label
> +     is a 'default' label.
> +   Operand 1 is CASE_HIGH.  If it is NULL_TREE, the label is a simple
> +     (one-value) case label.  If it is non-NULL_TREE, the case is a range.
> +   Operand 2 is CASE_LABEL, which is is the corresponding LABEL_DECL.
> +   Operand 4 is CASE_CHAIN.  This operand is only used in tree-cfg.c to
> +     speed up the lookup of case labels which use a particular edge in
> +     the control flow graph.  */
>  DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4)

Typo: the last one's operand 3 not 4.  ;-)

> --- tree-cfg.c  (revision 186526)
> +++ tree-cfg.c  (working copy)
> @@ -56,7 +56,7 @@ static const int initial_cfg_capacity = 20;
> 
>  /* This hash table allows us to efficiently lookup all CASE_LABEL_EXPRs
>     which use a particular edge.  The CASE_LABEL_EXPRs are chained together
> -   via their TREE_CHAIN field, which we clear after we're done with the
> +   via their CASE_CHAIN field, which we clear after we're done with the
>     hash table to prevent problems with duplication of GIMPLE_SWITCHes.
> 
>     Access to this list of CASE_LABEL_EXPRs allows us to efficiently

The thing doing the "clear after we're done" likewise needs to get its
documentation updated.  ;-)

As obvious, committed to trunk in r237384:

commit 00091facd9b1a23f371a11b4c48e7a106f6d1011
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Mon Jun 13 16:10:35 2016 +0000

    Fix CASE_CHAIN typos
    
    	gcc/
    	* tree-cfg.c (edge_to_cases_cleanup): Fix CASE_CHAIN typo.
    	* tree.def (CASE_LABEL_EXPR): Likewise.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237384 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog  | 5 +++++
 gcc/tree-cfg.c | 2 +-
 gcc/tree.def   | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git gcc/ChangeLog gcc/ChangeLog
index c2f0f7e..733e512 100644
--- gcc/ChangeLog
+++ gcc/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-13  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* tree-cfg.c (edge_to_cases_cleanup): Fix CASE_CHAIN typo.
+	* tree.def (CASE_LABEL_EXPR): Likewise.
+
 2016-06-13  Bernd Edlinger  <bernd.edlinger@hotmail.de>
 
 	* input.c (test_builtins): Fix an assertion.
diff --git gcc/tree-cfg.c gcc/tree-cfg.c
index 40e524b..0fac49c 100644
--- gcc/tree-cfg.c
+++ gcc/tree-cfg.c
@@ -1126,7 +1126,7 @@ make_cond_expr_edges (basic_block bb)
 /* Called for each element in the hash table (P) as we delete the
    edge to cases hash table.
 
-   Clear all the TREE_CHAINs to prevent problems with copying of
+   Clear all the CASE_CHAINs to prevent problems with copying of
    SWITCH_EXPRs and structure sharing rules, then free the hash table
    element.  */
 
diff --git gcc/tree.def gcc/tree.def
index d16575a..2c35540 100644
--- gcc/tree.def
+++ gcc/tree.def
@@ -949,7 +949,7 @@ DEFTREECODE (SWITCH_EXPR, "switch_expr", tcc_statement, 3)
    Operand 1 is CASE_HIGH.  If it is NULL_TREE, the label is a simple
      (one-value) case label.  If it is non-NULL_TREE, the case is a range.
    Operand 2 is CASE_LABEL, which is is the corresponding LABEL_DECL.
-   Operand 4 is CASE_CHAIN.  This operand is only used in tree-cfg.c to
+   Operand 3 is CASE_CHAIN.  This operand is only used in tree-cfg.c to
      speed up the lookup of case labels which use a particular edge in
      the control flow graph.  */
 DEFTREECODE (CASE_LABEL_EXPR, "case_label_expr", tcc_statement, 4)


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-13 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-18 15:32 [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c Steven Bosscher
2012-04-18 20:56 ` Tom Tromey
2016-06-13 16:13 ` Fix CASE_CHAIN typos (was: [patch] Fix CASE_LABEL_EXPR documentation in tree.def and tree-cfg.c) Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).