aboutsummaryrefslogtreecommitdiff
path: root/gdb/completer.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-11-20 18:18:39 +0000
committerTom Tromey <tromey@redhat.com>2012-11-20 18:18:39 +0000
commitec6632d76b88e151af88bd22fdb310e9dcbb93f5 (patch)
tree2e8e729e3fa14b3d99d26f366257502469e05b54 /gdb/completer.c
parentbacebabc8edc98e5651097a1d2640ffe81736004 (diff)
downloadgdb-ec6632d76b88e151af88bd22fdb310e9dcbb93f5.zip
gdb-ec6632d76b88e151af88bd22fdb310e9dcbb93f5.tar.gz
gdb-ec6632d76b88e151af88bd22fdb310e9dcbb93f5.tar.bz2
* completer.c (count_struct_fields): Remove.
(expression_completer): Don't call count_struct_fields.
Diffstat (limited to 'gdb/completer.c')
-rw-r--r--gdb/completer.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/gdb/completer.c b/gdb/completer.c
index 2002578..0815711 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -327,39 +327,6 @@ location_completer (struct cmd_list_element *ignore,
return list;
}
-/* Helper for expression_completer which recursively counts the number
- of named fields and methods in a structure or union type. */
-static int
-count_struct_fields (struct type *type)
-{
- int i, result = 0;
-
- CHECK_TYPEDEF (type);
- for (i = 0; i < TYPE_NFIELDS (type); ++i)
- {
- if (i < TYPE_N_BASECLASSES (type))
- result += count_struct_fields (TYPE_BASECLASS (type, i));
- else if (TYPE_FIELD_NAME (type, i))
- {
- if (TYPE_FIELD_NAME (type, i)[0] != '\0')
- ++result;
- else if (TYPE_CODE (TYPE_FIELD_TYPE (type, i)) == TYPE_CODE_UNION)
- {
- /* Recurse into anonymous unions. */
- result += count_struct_fields (TYPE_FIELD_TYPE (type, i));
- }
- }
- }
-
- for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
- {
- if (TYPE_FN_FIELDLIST_NAME (type, i))
- ++result;
- }
-
- return result;
-}
-
/* Helper for expression_completer which recursively adds field and
method names from TYPE, a struct or union type, to the array
OUTPUT. */
@@ -447,7 +414,6 @@ expression_completer (struct cmd_list_element *ignore,
if (TYPE_CODE (type) == TYPE_CODE_UNION
|| TYPE_CODE (type) == TYPE_CODE_STRUCT)
{
- int alloc = count_struct_fields (type);
int flen = strlen (fieldname);
VEC (char_ptr) *result = NULL;