public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Martin Liska <marxin@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1244] genhooks: remove dead code Date: Sun, 6 Jun 2021 17:06:17 +0000 (GMT) [thread overview] Message-ID: <20210606170617.7FA8B3855007@sourceware.org> (raw) 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); }
reply other threads:[~2021-06-06 17:06 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210606170617.7FA8B3855007@sourceware.org \ --to=marxin@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).