From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1851) id 7FA8B3855007; Sun, 6 Jun 2021 17:06:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FA8B3855007 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Martin Liska To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-1244] genhooks: remove dead code X-Act-Checkin: gcc X-Git-Author: Martin Liska X-Git-Refname: refs/heads/master X-Git-Oldrev: 4e65bf5ace0437e1c5f182dba056d846829c0c33 X-Git-Newrev: 0bc0e6173f517bea7b80913199a8a7286d5a5347 Message-Id: <20210606170617.7FA8B3855007@sourceware.org> Date: Sun, 6 Jun 2021 17:06:17 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jun 2021 17:06:17 -0000 https://gcc.gnu.org/g:0bc0e6173f517bea7b80913199a8a7286d5a5347 commit r12-1244-g0bc0e6173f517bea7b80913199a8a7286d5a5347 Author: Martin Liska 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); }