public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: binutils@emagii.com
To: binutils@sourceware.org
Cc: nickc@redhat.com, Tom Tromey <tromey@adacore.com>
Subject: [PATCH v9 02/11] Remove value_in
Date: Thu,  2 Mar 2023 23:03:59 +0100	[thread overview]
Message-ID: <20230302220408.1925678-3-binutils@emagii.com> (raw)
In-Reply-To: <20230302220408.1925678-1-binutils@emagii.com>

From: Tom Tromey <tromey@adacore.com>

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);
 
-- 
2.34.1


  parent reply	other threads:[~2023-03-02 22:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-02 22:03 [PATCH v9 0/11 Add support for CRC64 generation in linker binutils
2023-03-02 22:03 ` [PATCH v9 01/11] [gdb/testsuite] Fix gdb.rust/watch.exp on ppc64le binutils
2023-03-02 22:03 ` binutils [this message]
2023-03-02 22:04 ` [PATCH v9 03/11] [gdb/testsuite] Fix gdb.python/py-breakpoint.exp timeouts binutils
2023-03-02 22:04 ` [PATCH v9 04/11] gdb: add HtabPrinter to gdb-gdb.py.in binutils
2023-03-02 22:04 ` [PATCH v9 05/11] Automatic date update in version.in binutils
2023-03-02 22:04 ` [PATCH v9 06/11] Memory leak in gas do_repeat binutils
2023-03-02 22:04 ` [PATCH v9 07/11] gas s_fill caused internal error in frag_new binutils
2023-03-02 22:04 ` [PATCH v9 08/11] Catch overflow in gas s_space binutils
2023-03-02 22:04 ` [PATCH v9 09/11] [gdb/testsuite] Add another xfail case in gdb.python/py-record-btrace.exp binutils
2023-03-02 22:04 ` [PATCH v9 10/11] Fix btrace regression binutils
2023-03-02 22:04 ` [PATCH v9 11/11] Fix typo with my email address binutils
2023-03-02 23:09 ` [PATCH v9 0/11 Add support for CRC64 generation in linker Ulf Samuelsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230302220408.1925678-3-binutils@emagii.com \
    --to=binutils@emagii.com \
    --cc=binutils@sourceware.org \
    --cc=nickc@redhat.com \
    --cc=tromey@adacore.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).