aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc/cfg.texi
diff options
context:
space:
mode:
authorArsen Arsenović <arsen@aarsen.me>2023-02-23 11:27:11 +0100
committerGerald Pfeifer <gerald@pfeifer.com>2023-02-23 23:42:01 +0100
commitf33d7a88d069d169bbe76da8e5c52de17f68ca05 (patch)
tree6d399142c972278067733d030a73fb2e807af488 /gcc/doc/cfg.texi
parentf83e76c3f998c8708fe2ddca16ae3f317c39c37a (diff)
downloadgcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.zip
gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.tar.gz
gcc-f33d7a88d069d169bbe76da8e5c52de17f68ca05.tar.bz2
**/*.texi: Reorder index entries
This change is a generalization of r13-6292-gddf6fe375d9110. Historically, makeinfo exhibited a bug, due to which a structure like: @item foo @cindex foo @cindex bar ... would be transformed into an item heading, with the first index entry on it, followed by an item body, with the second index entry in it. This has often lead to index entries not linking to relevant items, but rather, just below them. This bug was exhibited in both Info and HTML documentation, and was most glaringly obvious in the latter. After a discussion with the Texinfo developers, it was decided that the appropriate construct for this case is: @cindex foo @cindex bar @item foo ... which behaves correctly in newer versions, linking all the index entries to the item itself. This pattern also produces copiable anchors in HTML output. This commit fixes most indices to follow the pattern above, however, omits relevant changes in the Ada manuals, as the algorithm described below lead to many false positives and unwanted changes in that manual. Much like the previous commit, this change is mostly mechanical, with a simple script. I have, however, gone over the patch myself also, to see if there's anything that ought to be kept as-is. Formatter: # GPL3+ use v5.35; use strict; use warnings; my @lineq = (); my @itemq = (); my @indxq = (); my $lstin = 0; while (<>) { push (@lineq, $_); if (/^\@[a-zA-Z0-9]{1,2}index\W/) { $lstin = @lineq; push (@indxq, $_); next; } if (/^\@itemx?\W/) { $lstin = @lineq; push (@itemq, $_); next; } next if $lstin && /^\s*(\@c(omment)?\W.*)?$/; if (@indxq and @itemq) { print @indxq; print @itemq; print @lineq[$lstin..@lineq-1]; } else { print @lineq; } @lineq = (); @itemq = (); @indxq = (); $lstin = 0; } if (@indxq and @itemq) { print @indxq; print @itemq; print @lineq[$lstin..@lineq-1]; } else { print @lineq; } # Local Variables: # indent-tabs-mode: nil # End: gcc/d/ChangeLog: * implement-d.texi: Reorder index entries around @items. gcc/ChangeLog: * doc/cfg.texi: Reorder index entries around @items. * doc/cpp.texi: Ditto. * doc/cppenv.texi: Ditto. * doc/cppopts.texi: Ditto. * doc/generic.texi: Ditto. * doc/install.texi: Ditto. * doc/extend.texi: Ditto. * doc/invoke.texi: Ditto. * doc/md.texi: Ditto. * doc/rtl.texi: Ditto. * doc/tm.texi.in: Ditto. * doc/trouble.texi: Ditto. * doc/tm.texi: Regenerate. gcc/fortran/ChangeLog: * invoke.texi: Reorder index entries around @items. gcc/go/ChangeLog: * gccgo.texi: Reorder index entries around @items.
Diffstat (limited to 'gcc/doc/cfg.texi')
-rw-r--r--gcc/doc/cfg.texi12
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/doc/cfg.texi b/gcc/doc/cfg.texi
index fa2f5a8..6fb9c9f 100644
--- a/gcc/doc/cfg.texi
+++ b/gcc/doc/cfg.texi
@@ -269,8 +269,8 @@ These edges are used for unconditional or conditional jumps and in
RTL also for table jumps. They are the easiest to manipulate as they
may be freely redirected when the flow graph is not in SSA form.
-@item fall-thru
@findex EDGE_FALLTHRU, force_nonfallthru
+@item fall-thru
Fall-thru edges are present in case where the basic block may continue
execution to the following one without branching. These edges have
the @code{EDGE_FALLTHRU} flag set. Unlike other types of edges, these
@@ -279,9 +279,9 @@ instruction stream. The function @code{force_nonfallthru} is
available to insert an unconditional jump in the case that redirection
is needed. Note that this may require creation of a new basic block.
-@item exception handling
@cindex exception handling
@findex EDGE_ABNORMAL, EDGE_EH
+@item exception handling
Exception handling edges represent possible control transfers from a
trapping instruction to an exception handler. The definition of
``trapping'' varies. In C++, only function calls can throw, but for
@@ -310,17 +310,17 @@ but this predicate only checks for possible memory traps, as in
dereferencing an invalid pointer location.
-@item sibling calls
@cindex sibling call
@findex EDGE_ABNORMAL, EDGE_SIBCALL
+@item sibling calls
Sibling calls or tail calls terminate the function in a non-standard
way and thus an edge to the exit must be present.
@code{EDGE_SIBCALL} and @code{EDGE_ABNORMAL} are set in such case.
These edges only exist in the RTL representation.
-@item computed jumps
@cindex computed jump
@findex EDGE_ABNORMAL
+@item computed jumps
Computed jumps contain edges to all labels in the function referenced
from the code. All those edges have @code{EDGE_ABNORMAL} flag set.
The edges used to represent computed jumps often cause compile time
@@ -369,9 +369,9 @@ Be aware of that when you work on passes in that area. There have
been numerous examples already where the compile time for code with
unfactored computed jumps caused some serious headaches.
-@item nonlocal goto handlers
@cindex nonlocal goto handler
@findex EDGE_ABNORMAL, EDGE_ABNORMAL_CALL
+@item nonlocal goto handlers
GCC allows nested functions to return into caller using a @code{goto}
to a label passed to as an argument to the callee. The labels passed
to nested functions contain special code to cleanup after function
@@ -380,9 +380,9 @@ receivers''. If a function contains such nonlocal goto receivers, an
edge from the call to the label is created with the
@code{EDGE_ABNORMAL} and @code{EDGE_ABNORMAL_CALL} flags set.
-@item function entry points
@cindex function entry point, alternate function entry point
@findex LABEL_ALTERNATE_NAME
+@item function entry points
By definition, execution of function starts at basic block 0, so there
is always an edge from the @code{ENTRY_BLOCK_PTR} to basic block 0.
There is no @code{GIMPLE} representation for alternate entry points at