From patchwork Thu Sep 28 17:46:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 146241 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3493112vqu; Thu, 28 Sep 2023 10:53:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwQ/zK/oCFA3i77LvNrF35KFVNrM7wBK5aZpLZsIWjGD9hJFCyYacNW2a9bXbNnCmHNCi7 X-Received: by 2002:a05:6512:360d:b0:503:446:b468 with SMTP id f13-20020a056512360d00b005030446b468mr1727408lfs.67.1695923620171; Thu, 28 Sep 2023 10:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695923620; cv=none; d=google.com; s=arc-20160816; b=s4RsayjU98ztcqGL7xl085Wd6DRX7HnjG8jjzrSk5Z9EHaV+fbDCz1l5KYEW5nPvOv hFxpc2vdN7cgBIcuWur1OW8Hh0HV1hGfLHWTeETB5kkJguneHy4/TCcyx/cQ1cpOJcQR WhmL31PLMCJfcRoaSItksMwCCZjAl9HF6BOyOAYq+vd504q/YJYhJeR8WnwzFTQkaAr2 HojRAr+HK+95/xwcvss4X9rVV3lUokpAssPK6C/ehPyHA1NEuL1bOo980+TyRKGtEKds MxgtENNAyjiFWqx59/RoKvsYd7E5o+UHumoPQHIlI4nzyd4qCoD1Cn8qhFWKiKAgue+b /zfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=g65ZFUqbpWfKghBHY26Hxt9+z+42jGr00b4/SOFo5+I=; fh=Ogh3zaPUNpdNYHofIVNHsbX+D3lwaT1T8Jhe/MolwAA=; b=wQTBKgVIBFXoEh1J8rOHT7eXg4+ZIQYepa4cz4eEUhbfSeNOHPXnBUXHWfh24RqGmu 6jcd7wM31D/BiZCa/qJpYPSJ74F8s9E5O1KpxAyJkfbvYAeJoBc/9wR4+DRTwkTQXHmr DZbBZpyV4WsouE/i5oHBQH6FT2NVrRNjl1HN0ao4M6bKai0RJSIisimtoYxGb1iQCNmP xqfCm78gB37mA9ePtxweQOWzobIVpKf/8i0A8JWA+gvlTfkjxWPyF4DkFhjpOyPHUj4B YRy4Or8GjB9I+7rxPJL1/F2KUHwBuH0IajpRE3NPiIc7OlO/KzN7oxqf1sJKtcVG6kWG vd5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=aWzZCe2U; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h22-20020aa7c956000000b00530df47f178si14405695edt.309.2023.09.28.10.53.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:53:40 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@adacore.com header.s=google header.b=aWzZCe2U; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=adacore.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1F49C38768A7 for ; Thu, 28 Sep 2023 17:48:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 805203861858 for ; Thu, 28 Sep 2023 17:46:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 805203861858 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-3513fa06bafso28039935ab.3 for ; Thu, 28 Sep 2023 10:46:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1695923203; x=1696528003; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g65ZFUqbpWfKghBHY26Hxt9+z+42jGr00b4/SOFo5+I=; b=aWzZCe2U+W/HkBsrexif5XXW02UQYuPdpCKQz61LkVVTDNnl8+zWmuMC/+x+JHS+kU SAgmJ/Q7kzbt4qw034W0S9ca6jeslUzvVOGbVJNrX95Bl9KE7i1GGjy1B8/ejfPvmObV f5/U3MW1rTXAAgC5OU20GEgraALydBXrR7DIvgExBKWrTeNkJ2NEvMZOPj3GVfL4ozwP Up0hxNcc30iherDZlS7ECw6k5ojNunS0mqfXmWFSgQHRmcwlVB0ceX5oN9PTwm/PS6hq aBMlfO+xmXZVXe3/m/POKa6DqszonEwcJvXBNm6dO3UNjoBSpsZnnOLrI5Yo1GPgknY3 Lt/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695923203; x=1696528003; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g65ZFUqbpWfKghBHY26Hxt9+z+42jGr00b4/SOFo5+I=; b=By14bDaozW8qzOWH+yUSkg13ffo/N5vGkfd0TffrZjus8+08pTPFnTuki+oRuU0dOF JRDlFfxi+T1jxJ+nYuqhjJbu9aCd+q5EQ0sPHpeOVExgyTLZ+RjzpigvI+JSSbTaLGOb a8vTP5fTW/HwGlvaYqlArPRPaIJGf9GcXMZtHnNV/4sonOmKsgKRKHqylz0gs8eOArNn rBxWJGYutpDfq3veHw8q/cATJgqw1dEwsBSLSx0jn3tAjeb4/gs7bkXqheoau4TThy9G 4NZTYVy80yxEXBL3hyce5ek8ZLZyumvECi63THanCDgOsjBpzGO68RzVrH8cAngoVHH4 qH6Q== X-Gm-Message-State: AOJu0YwntSqzsPGX3ThRIgTzib4agf0DxdwBZi2mreslj+ArkZ2VIbOF 9k66YgoPviEt89GxSA6vWwC9If3bKNS2EsYzIxhdHA== X-Received: by 2002:a05:6e02:1307:b0:351:b22:af5c with SMTP id g7-20020a056e02130700b003510b22af5cmr1376617ilr.32.1695923203790; Thu, 28 Sep 2023 10:46:43 -0700 (PDT) Received: from localhost.localdomain (71-211-130-31.hlrn.qwest.net. [71.211.130.31]) by smtp.gmail.com with ESMTPSA id p6-20020a92d486000000b0034fc8c1c24fsm3450963ilg.54.2023.09.28.10.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 10:46:43 -0700 (PDT) From: Tom Tromey To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Tom Tromey Subject: [PATCH 4/7] libstdc++: Remove unused locals from printers.py Date: Thu, 28 Sep 2023 11:46:27 -0600 Message-Id: <20230928174630.4004388-5-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230928174630.4004388-1-tromey@adacore.com> References: <20230928174630.4004388-1-tromey@adacore.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778304805756009072 X-GMAIL-MSGID: 1778304805756009072 flake8 pointed out some unused local variables in the libstdc++ pretty-printers. This removes them. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (StdExpOptionalPrinter.__init__, lookup_node_type): Remove unused variables. --- libstdc++-v3/python/libstdcxx/v6/printers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 8d44244afb0..6bf4fe891fd 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -169,7 +169,7 @@ def lookup_node_type(nodename, containertype): valtype = valtype.strip_typedefs() try: return lookup_templ_spec(nodename, valtype) - except gdb.error as e: + except gdb.error: # For debug mode containers the node is in std::__cxx1998. if is_member_of_namespace(nodename, 'std'): if is_member_of_namespace(containertype, 'std::__cxx1998', @@ -1423,7 +1423,6 @@ class StdExpOptionalPrinter(SingleObjContainerPrinter): "Print a std::optional or std::experimental::optional" def __init__(self, typename, val): - valtype = self._recognize(val.type.template_argument(0)) typename = strip_versioned_namespace(typename) self._typename = re.sub( '^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3', typename, 1)