public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1244] genhooks: remove dead code
@ 2021-06-06 17:06 Martin Liska
0 siblings, 0 replies; only message in thread
From: Martin Liska @ 2021-06-06 17:06 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:0bc0e6173f517bea7b80913199a8a7286d5a5347
commit r12-1244-g0bc0e6173f517bea7b80913199a8a7286d5a5347
Author: Martin Liska <mliska@suse.cz>
Date: Fri Jun 4 13:12:02 2021 +0200
genhooks: remove dead code
gcc/ChangeLog:
* genhooks.c (emit_findices): Remove unused function.
(emit_documentation): Do not call emit_findices
and do not search for @Fcode directives.
Diff:
---
gcc/genhooks.c | 33 +++------------------------------
1 file changed, 3 insertions(+), 30 deletions(-)
diff --git a/gcc/genhooks.c b/gcc/genhooks.c
index 2e63940ffdf..ebe0d0954e6 100644
--- a/gcc/genhooks.c
+++ b/gcc/genhooks.c
@@ -38,26 +38,6 @@ static struct hook_desc hook_array[] = {
#undef DEFHOOK
};
-/* For each @Fcode in the first paragraph of the documentation string DOC,
- print an @findex directive. HOOK_NAME is the name of the hook this bit of
- documentation pertains to. */
-static void
-emit_findices (const char *doc, const char *hook_name)
-{
- const char *end = strstr (doc, "\n\n");
- const char *fcode;
-
- while ((fcode = strstr (doc, "@Fcode{")) && (!end || fcode < end))
- {
- fcode += strlen ("@Fcode{");
- doc = strchr (fcode, '}');
- if (!doc)
- fatal ("Malformed @Fcode for hook %s\n", hook_name);
- printf ("@findex %.*s\n", (int) (doc - fcode), fcode);
- doc = fcode;
- }
-}
-
/* Return an upper-case copy of IN. */
static char *
upstrdup (const char *in)
@@ -99,8 +79,8 @@ s_hook_eq_p (const void *p1, const void *p2)
signature, followed by the string from the doc field.
The documentation is bracketed in @deftypefn / @deftypevr and a matching
@end.
- While emitting the doc field, @Fcode is translated to @code, and an
- @findex entry is added to the affected paragraph.
+ While emitting the doc field, an @findex entry is added
+ to the affected paragraph.
If the doc field starts with '*', the leading '*' is stripped, and the doc
field is otherwise emitted unaltered; no function signature/
@deftypefn/deftypevr/@end is emitted.
@@ -206,7 +186,7 @@ emit_documentation (const char *in_fname)
{
const char *q, *e;
const char *deftype;
- const char *doc, *fcode, *p_end;
+ const char *doc, *p_end;
/* A leading '*' means to output the documentation string without
further processing. */
@@ -216,7 +196,6 @@ emit_documentation (const char *in_fname)
{
if (i != shp->pos)
printf ("\n\n");
- emit_findices (hook_array[i].doc, name);
/* Print header. Function-valued hooks have a parameter list,
unlike POD-valued ones. */
@@ -262,13 +241,7 @@ emit_documentation (const char *in_fname)
/* Find paragraph end. */
p_end = strstr (doc, "\n\n");
p_end = (p_end ? p_end + 2 : doc + strlen (doc));
- /* Print paragraph, emitting @Fcode as @code. */
- for (; (fcode = strstr (doc, "@Fcode{")) && fcode < p_end;
- doc = fcode + 2)
- printf ("%.*s@", (int) (fcode - doc), doc);
printf ("%.*s", (int) (p_end - doc), doc);
- /* Emit function indices for next paragraph. */
- emit_findices (p_end, name);
}
printf ("\n@end %s", deftype);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-06 17:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-06 17:06 [gcc r12-1244] genhooks: remove dead code Martin Liska
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).