From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 9F4213858404; Tue, 28 Feb 2023 14:25:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F4213858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677594312; bh=HaHsMJIm57ntamiLgpRpRSSnh7cs4wLsLRL0J5+blac=; h=From:To:Subject:Date:From; b=oThJ/ZneA6NtxTLMS+AB1pCS61l+W5hXkwsoLKpbEBWrZR6bWl3EpwBQ0z6PTl0LM /U4+jNhDwiCudi/XnCAon6+X4y6QxFmeWNoLiwvoZxf8MM25bbZZ+2MDhI5eQIpA6A IXDL/uk531P4ClRaw4OH66LzY/Nd6qXHIxgo5vbs= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Remove value_in X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 7226dd9faabbe6987e5910483374752ca7934255 X-Git-Newrev: eae679b9c7760e994c85695946c6b69a227dc69b Message-Id: <20230228142512.9F4213858404@sourceware.org> Date: Tue, 28 Feb 2023 14:25:12 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Deae679b9c776= 0e994c85695946c6b69a227dc69b commit eae679b9c7760e994c85695946c6b69a227dc69b Author: Tom Tromey Date: Tue Feb 28 07:19:41 2023 -0700 Remove value_in =20 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. Diff: --- 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 =3D 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 =3D check_typedef (set->type ()); - struct type *eltype =3D check_typedef (element->type ()); - - if (eltype->code () =3D=3D TYPE_CODE_RANGE) - eltype =3D eltype->target_type (); - if (settype->code () !=3D TYPE_CODE_SET) - error (_("Second argument of 'IN' has wrong type")); - if (eltype->code () !=3D TYPE_CODE_INT - && eltype->code () !=3D TYPE_CODE_CHAR - && eltype->code () !=3D TYPE_CODE_ENUM - && eltype->code () !=3D TYPE_CODE_BOOL) - error (_("First argument of 'IN' has wrong type")); - member =3D 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 (struc= t type *type, extern struct value *register_value_being_returned (struct type *valtype, struct regcache *retbuf); =20 -extern int value_in (struct value *element, struct value *set); - extern int value_bit_index (struct type *type, const gdb_byte *addr, int index);