From patchwork Tue Feb 28 14:24:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 65775 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0BF913858289 for ; Tue, 28 Feb 2023 14:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BF913858289 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677594297; bh=iE5dKgyqj12rRraCFPP6K++YZ2mWcr+JeimsPYn14jI=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=Yb2Gf5TywE9x4UMZy9t0iTmCvupAM+ngx2LtOP1l76Dv/9fycGGPNl+JC8xJysIkW MbMUXhsVjqW9SpNuqJM5w4+uAut7+IzwZGsuGM7t7ENR8daJY5BRYAuD1N4QqD77vZ FvPc/d12KvDRURcPb+B6delRyUu7oNo+/A3BgDPc= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x135.google.com (mail-il1-x135.google.com [IPv6:2607:f8b0:4864:20::135]) by sourceware.org (Postfix) with ESMTPS id C83673858D39 for ; Tue, 28 Feb 2023 14:24:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C83673858D39 Received: by mail-il1-x135.google.com with SMTP id b16so6370252iln.3 for ; Tue, 28 Feb 2023 06:24:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iE5dKgyqj12rRraCFPP6K++YZ2mWcr+JeimsPYn14jI=; b=R+AXW2cDiQj8Q9nMFwuz0YgCqazKQ5O5gmJC90juW6+jUwtDFgvbnQk3A7u8K7ZTVt AEA/MFSgDQvgA4DYS/cuAMCKJ+wFVDJ+gxBmXgHE0uhm8wCzQtdmdQxaBftfphygz/ua fGx4dpmKB3uMPcCjpYYWPCwYb5b9QRZjZbtLN+dZUB/dlH+KLDMkJYf/+PUsQ/9BBUy+ C3cqC5yZDz12RYYlhuI3leTAcCNmjgQge4ztLpg5mzht0aOwdm8jyUsUj1SU2ufmxv+2 plR8B8ibNlDdIhhcKyQvMlXTdPvYHt0UpXXB9bTIOHmvmbwtsvEKH8K6foYis5OU+c9A H+3Q== X-Gm-Message-State: AO0yUKVX29nuTHOkNqnu6i3KfzwOfTKe3aR+E5HuopRI3Px9OJF4uMwm LKhaMQZwgwnUUHCqvpRal93X/K2DiSG+zUFR X-Google-Smtp-Source: AK7set82aiblya71V4mKGn11HsOOpmRnmj3K1Ul4MTQ4rd1nA8k3JUT9D1sTuvrc6XSrdLHVjmQ7RA== X-Received: by 2002:a05:6e02:1a49:b0:314:5aa:94b6 with SMTP id u9-20020a056e021a4900b0031405aa94b6mr2842975ilv.24.1677594257927; Tue, 28 Feb 2023 06:24:17 -0800 (PST) Received: from localhost.localdomain (75-166-130-93.hlrn.qwest.net. [75.166.130.93]) by smtp.gmail.com with ESMTPSA id r10-20020a02c6ca000000b003acde48bdc3sm2877642jan.111.2023.02.28.06.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Feb 2023 06:24:17 -0800 (PST) To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Remove value_in Date: Tue, 28 Feb 2023 07:24:10 -0700 Message-Id: <20230228142410.2875314-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" value_in is unused. From git log, it seems to have been part of the Chill language, which was removed from gdb eons ago. This patch removes the function. Tested by rebuilding. --- gdb/valarith.c | 23 ----------------------- gdb/value.h | 2 -- 2 files changed, 25 deletions(-) diff --git a/gdb/valarith.c b/gdb/valarith.c index a6a5f5102a2..070ee63808e 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -2020,26 +2020,3 @@ value_bit_index (struct type *type, const gdb_byte *valaddr, int index) rel_index = TARGET_CHAR_BIT - 1 - rel_index; return (word >> rel_index) & 1; } - -int -value_in (struct value *element, struct value *set) -{ - int member; - struct type *settype = check_typedef (set->type ()); - struct type *eltype = check_typedef (element->type ()); - - if (eltype->code () == TYPE_CODE_RANGE) - eltype = eltype->target_type (); - if (settype->code () != TYPE_CODE_SET) - error (_("Second argument of 'IN' has wrong type")); - if (eltype->code () != TYPE_CODE_INT - && eltype->code () != TYPE_CODE_CHAR - && eltype->code () != TYPE_CODE_ENUM - && eltype->code () != TYPE_CODE_BOOL) - error (_("First argument of 'IN' has wrong type")); - member = value_bit_index (settype, set->contents ().data (), - value_as_long (element)); - if (member < 0) - error (_("First argument of 'IN' not in range")); - return member; -} diff --git a/gdb/value.h b/gdb/value.h index f2a4907ab81..c3eb96bf143 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -1270,8 +1270,6 @@ extern struct value *value_bitstring_subscript (struct type *type, extern struct value *register_value_being_returned (struct type *valtype, struct regcache *retbuf); -extern int value_in (struct value *element, struct value *set); - extern int value_bit_index (struct type *type, const gdb_byte *addr, int index);