* symtab.c (check_field): Now static. Move from...
authorTom Tromey <tromey@redhat.com>
Fri, 14 Dec 2012 17:16:16 +0000 (17:16 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 14 Dec 2012 17:16:16 +0000 (17:16 +0000)
* valops.c (check_field): ... here.  Remove.
* value.h (check_field): Don't declare.

gdb/ChangeLog
gdb/symtab.c
gdb/valops.c
gdb/value.h

index b8dee9391ead45d3bff661e6ed6388df1bd06d83..b33c14229c0cd9bf1fb7b8039ee6da0fafe89629 100644 (file)
@@ -1,3 +1,9 @@
+2012-12-14  Tom Tromey  <tromey@redhat.com>
+
+       * symtab.c (check_field): Now static.  Move from...
+       * valops.c (check_field): ... here.  Remove.
+       * value.h (check_field): Don't declare.
+
 2012-12-14  Tom Tromey  <tromey@redhat.com>
 
         * NEWS: Mention "info proc" and core files.
index 1b0b35bcd7c765d8038e2b39cfb931d7ea830e78..1de3454401c5c2667b421ac4744ae9381f8637e6 100644 (file)
@@ -1278,6 +1278,42 @@ lookup_language_this (const struct language_defn *lang,
   return NULL;
 }
 
+/* Given TYPE, a structure/union,
+   return 1 if the component named NAME from the ultimate target
+   structure/union is defined, otherwise, return 0.  */
+
+static int
+check_field (struct type *type, const char *name)
+{
+  int i;
+
+  /* The type may be a stub.  */
+  CHECK_TYPEDEF (type);
+
+  for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
+    {
+      const char *t_field_name = TYPE_FIELD_NAME (type, i);
+
+      if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
+       return 1;
+    }
+
+  /* C++: If it was not found as a data field, then try to return it
+     as a pointer to a method.  */
+
+  for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
+    {
+      if (strcmp_iw (TYPE_FN_FIELDLIST_NAME (type, i), name) == 0)
+       return 1;
+    }
+
+  for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
+    if (check_field (TYPE_BASECLASS (type, i), name))
+      return 1;
+
+  return 0;
+}
+
 /* Behave like lookup_symbol except that NAME is the natural name
    (e.g., demangled name) of the symbol that we're looking for.  */
 
index 372f1186eeb19bf2639731344c95540dfb67c0c5..fada3a5102af8c45b030fa5fd019da250aacb925 100644 (file)
@@ -3180,42 +3180,6 @@ destructor_name_p (const char *name, struct type *type)
   return 0;
 }
 
-/* Given TYPE, a structure/union,
-   return 1 if the component named NAME from the ultimate target
-   structure/union is defined, otherwise, return 0.  */
-
-int
-check_field (struct type *type, const char *name)
-{
-  int i;
-
-  /* The type may be a stub.  */
-  CHECK_TYPEDEF (type);
-
-  for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
-    {
-      const char *t_field_name = TYPE_FIELD_NAME (type, i);
-
-      if (t_field_name && (strcmp_iw (t_field_name, name) == 0))
-       return 1;
-    }
-
-  /* C++: If it was not found as a data field, then try to return it
-     as a pointer to a method.  */
-
-  for (i = TYPE_NFN_FIELDS (type) - 1; i >= 0; --i)
-    {
-      if (strcmp_iw (TYPE_FN_FIELDLIST_NAME (type, i), name) == 0)
-       return 1;
-    }
-
-  for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
-    if (check_field (TYPE_BASECLASS (type, i), name))
-      return 1;
-
-  return 0;
-}
-
 /* C++: Given an aggregate type CURTYPE, and a member name NAME,
    return the appropriate member (or the address of the member, if
    WANT_ADDRESS).  This function is used to resolve user expressions
index 7a237153517f3f9a68108b2bcbc760a7cd9f2985..1b7b67963b44a4c370b6cba0170a59cac93b2e71 100644 (file)
@@ -913,8 +913,6 @@ extern void print_variable_and_value (const char *name,
                                      struct ui_file *stream,
                                      int indent);
 
-extern int check_field (struct type *, const char *);
-
 extern void typedef_print (struct type *type, struct symbol *news,
                           struct ui_file *stream);
 
This page took 0.035847 seconds and 4 git commands to generate.