From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 0DEE2385B50A for ; Sat, 25 Feb 2023 03:37:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0DEE2385B50A Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 31P3b0xY030125 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 24 Feb 2023 22:37:04 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 31P3b0xY030125 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1677296225; bh=Jc4lAlqrIl3M9lF5iaDtgy9xTgeWo/hS3/amWLesj6g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IM0LKkp2ygxCTeAU9iGK5CvaRaVrtN0hDbpVp4WFezr8Ei6Cb+f8dfPTql7b14THx C4Io6O9VCoJLpRQI/222ObUVsYW25w6izAuPpGikPAP56PweFjZiugY9Af5Brtp4Ss PQ62wF+p3h63fLGx0DfgyGpaej/3Kb+YxYahlLJE= Received: from simark.localdomain (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9BAD11E224; Fri, 24 Feb 2023 22:30:50 -0500 (EST) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH v2 04/10] gdb: gdbarch.py: remove Info.__init__ Date: Fri, 24 Feb 2023 22:30:41 -0500 Message-Id: <20230225033047.373899-5-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230225033047.373899-1-simon.marchi@polymtl.ca> References: <20230225033047.373899-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 25 Feb 2023 03:37:00 +0000 X-Spam-Status: No, score=-3189.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 List-Id: Info.__init__ currently assigns `self.predicate = None`. This was helpful to ensure that all component types had a `predicate` attribute. The generator code could then avoid having code like "if the component is anything but Info, use predicate". Since the previous commit, all component types have a predicate attribute which defaults to False. We can therefore remove the assignment in Info.__init__, and in turn remove Info.__init__. We however need to make the printer parameter of _Component.__init__ optional, as Info don't need a printer. Change-Id: I611edeca9cc9837eb49dddfe038595e1ff3b7239 --- gdb/gdbarch.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gdb/gdbarch.py b/gdb/gdbarch.py index 63c3aee1dc0e..f97f39b6db0f 100755 --- a/gdb/gdbarch.py +++ b/gdb/gdbarch.py @@ -53,7 +53,7 @@ class _Component: self, name, type, - printer, + printer=None, comment=None, predicate=False, predefault=None, @@ -97,11 +97,6 @@ class _Component: class Info(_Component): "An Info component is copied from the gdbarch_info." - def __init__(self, *, name, type, printer=None): - super().__init__(name=name, type=type, printer=printer) - # This little hack makes the generator a bit simpler. - self.predicate = None - class Value(_Component): "A Value component is just a data member." -- 2.39.2