From patchwork Sun Jun 6 17:05:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 1488322 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=t+dVxsYo; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uY2V5cAq; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=t+dVxsYo; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uY2V5cAq; dkim-atps=neutral Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FyjZG4rNXz9sRK for ; Mon, 7 Jun 2021 03:05:58 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A5763945C1D for ; Sun, 6 Jun 2021 17:05:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 6D7CF3855007 for ; Sun, 6 Jun 2021 17:05:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6D7CF3855007 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 873E521A70 for ; Sun, 6 Jun 2021 17:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622999132; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bGglzZGscGVLPa0cvK2y9EFLRpoK7/tScY74FcMr5k=; b=t+dVxsYoPtRpZs/CxhhEH26Oc03FO5ZvGSC5BCVpquTvfZ2r70HJA8EpPghfoj14zhXy+Q gxjMOL8L8MQhnLFDTCHTpyyr+w4cq0crSV89zgYQ+rXPbU59+mHhWHPinKYhahcYUSRwae 439PogNyFm7zEDi2mBvgrfCLqEhIcg4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622999132; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bGglzZGscGVLPa0cvK2y9EFLRpoK7/tScY74FcMr5k=; b=uY2V5cAqdCAWcBwoAL4Qs1DOv/iuakFZS+fNjF1+iQCHE2zDZyqgN3JyOF4II2gdGjF6sG S8rekkBw9TsTQXDQ== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id 68EDC118DD for ; Sun, 6 Jun 2021 17:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1622999132; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bGglzZGscGVLPa0cvK2y9EFLRpoK7/tScY74FcMr5k=; b=t+dVxsYoPtRpZs/CxhhEH26Oc03FO5ZvGSC5BCVpquTvfZ2r70HJA8EpPghfoj14zhXy+Q gxjMOL8L8MQhnLFDTCHTpyyr+w4cq0crSV89zgYQ+rXPbU59+mHhWHPinKYhahcYUSRwae 439PogNyFm7zEDi2mBvgrfCLqEhIcg4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1622999132; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5bGglzZGscGVLPa0cvK2y9EFLRpoK7/tScY74FcMr5k=; b=uY2V5cAqdCAWcBwoAL4Qs1DOv/iuakFZS+fNjF1+iQCHE2zDZyqgN3JyOF4II2gdGjF6sG S8rekkBw9TsTQXDQ== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id VPlAGFwAvWBANAAALh3uQQ (envelope-from ) for ; Sun, 06 Jun 2021 17:05:32 +0000 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][pushed] genhooks: remove dead code To: gcc-patches@gcc.gnu.org Message-ID: <34b375a6-ae32-45e1-bf69-c7ef0482f88a@suse.cz> Date: Sun, 6 Jun 2021 19:05:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-10.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hello. We not longer use @Fcode in .def target hooks and I'm going to remove a dead code. Pushed to master. Martin gcc/ChangeLog: * genhooks.c (emit_findices): Remove unused function. (emit_documentation): Do not call emit_findices and do not search for @Fcode directives. --- 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); }