public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] Remove value_in
@ 2023-02-28 14:24 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-02-28 14:24 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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.39.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-28 14:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-28 14:24 [pushed] Remove value_in Tom Tromey

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).