This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/Ada] Delete ada-exp.y:string_to_operator (unused)
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 24 Sep 2013 12:42:59 -0700
- Subject: [commit/Ada] Delete ada-exp.y:string_to_operator (unused)
- Authentication-results: sourceware.org; auth=none
Hello,
Keith pointed out to me that a function in ada-exp.y appears
to have been unused at least since 2004. I think it is time
to let it go...
gdb/ChangeLog:
* ada-exp.y (string_to_operator): Delete.
(dummy_string_to_ada_operator): Delete.
Tested on x86_64-linux. Checked in.
---
gdb/ChangeLog | 5 +++++
gdb/ada-exp.y | 39 ---------------------------------------
2 files changed, 5 insertions(+), 39 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index eda6ca9..582ce91 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-09-24 Joel Brobecker <brobecker@adacore.com>
+ * ada-exp.y (string_to_operator): Delete.
+ (dummy_string_to_ada_operator): Delete.
+
+2013-09-24 Joel Brobecker <brobecker@adacore.com>
+
Revert:
* i386-tdep.h (enum amd64_reg_class): New, moved here from
amd64-tdep.c.
diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index 702a32e..877dfaf 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -125,8 +125,6 @@ static int yylex (void);
void yyerror (char *);
-static struct stoken string_to_operator (struct stoken);
-
static void write_int (LONGEST, struct type *);
static void write_object_renaming (const struct block *, const char *, int,
@@ -786,34 +784,6 @@ yyerror (char *msg)
error (_("Error in expression, near `%s'."), lexptr);
}
-/* The operator name corresponding to operator symbol STRING (adds
- quotes and maps to lower-case). Destroys the previous contents of
- the array pointed to by STRING.ptr. Error if STRING does not match
- a valid Ada operator. Assumes that STRING.ptr points to a
- null-terminated string and that, if STRING is a valid operator
- symbol, the array pointed to by STRING.ptr contains at least
- STRING.length+3 characters. */
-
-static struct stoken
-string_to_operator (struct stoken string)
-{
- int i;
-
- for (i = 0; ada_opname_table[i].encoded != NULL; i += 1)
- {
- if (string.length == strlen (ada_opname_table[i].decoded)-2
- && strncasecmp (string.ptr, ada_opname_table[i].decoded+1,
- string.length) == 0)
- {
- strncpy (string.ptr, ada_opname_table[i].decoded,
- string.length+2);
- string.length += 2;
- return string;
- }
- }
- error (_("Invalid operator symbol `%s'"), string.ptr);
-}
-
/* Emit expression to access an instance of SYM, in block BLOCK (if
* non-NULL), and with :: qualification ORIG_LEFT_CONTEXT. */
static void
@@ -1533,12 +1503,3 @@ _initialize_ada_exp (void)
{
obstack_init (&temp_parse_space);
}
-
-/* FIXME: hilfingr/2004-10-05: Hack to remove warning. The function
- string_to_operator is supposed to be used for cases where one
- calls an operator function with prefix notation, as in
- "+" (a, b), but at some point, this code seems to have gone
- missing. */
-
-struct stoken (*dummy_string_to_ada_operator) (struct stoken)
- = string_to_operator;
--
1.8.1.2