gdb: Convert language la_lookup_transparent_type field to a method
[deliverable/binutils-gdb.git] / gdb / objc-lang.c
index 5126e9f4ca90eb613e2d1de362dfb5ed7e7d9ca3..040226c81d5a971a7f14f4d3bc741b8aca56bf64 100644 (file)
@@ -95,7 +95,7 @@ lookup_struct_typedef (const char *name, const struct block *block, int noerr)
       else 
        error (_("No struct type named %s."), name);
     }
-  if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
+  if (SYMBOL_TYPE (sym)->code () != TYPE_CODE_STRUCT)
     {
       if (noerr)
        return 0;
@@ -364,7 +364,10 @@ static const char *objc_extensions[] =
   ".m", NULL
 };
 
-extern const struct language_defn objc_language_defn = {
+/* Constant data representing the Objective-C language.  */
+
+extern const struct language_data objc_language_data =
+{
   "objective-c",               /* Language name */
   "Objective-C",
   language_objc,
@@ -381,15 +384,12 @@ extern const struct language_defn objc_language_defn = {
   c_emit_char,
   c_print_type,                        /* Print a type using appropriate syntax */
   c_print_typedef,             /* Print a typedef using appropriate syntax */
-  c_val_print,                 /* Print a value using appropriate syntax */
   c_value_print_inner,         /* la_value_print_inner */
   c_value_print,               /* Print a top-level value */
-  default_read_var_value,      /* la_read_var_value */
   objc_skip_trampoline,        /* Language specific skip_trampoline */
   "self",                      /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   objc_demangle,               /* Language specific symbol demangler */
   objc_sniff_from_mangled_name,
   NULL,                                /* Language specific
@@ -399,9 +399,6 @@ extern const struct language_defn objc_language_defn = {
   0,                           /* String lower bound */
   default_word_break_characters,
   default_collect_symbol_completion_matches,
-  c_language_arch_info,
-  default_print_array_index,
-  default_pass_by_reference,
   c_watch_location_expression,
   NULL,                                /* la_get_symbol_name_matcher */
   iterate_over_symbols,
@@ -413,6 +410,27 @@ extern const struct language_defn objc_language_defn = {
   "{...}"                      /* la_struct_too_deep_ellipsis */
 };
 
+/* Class representing the Objective-C language.  */
+
+class objc_language : public language_defn
+{
+public:
+  objc_language ()
+    : language_defn (language_objc, objc_language_data)
+  { /* Nothing.  */ }
+
+  /* See language.h.  */
+  void language_arch_info (struct gdbarch *gdbarch,
+                          struct language_arch_info *lai) const override
+  {
+    c_language_arch_info (gdbarch, lai);
+  }
+};
+
+/* Single instance of the class representing the Objective-C language.  */
+
+static objc_language objc_language_defn;
+
 /*
  * ObjC:
  * Following functions help construct Objective-C message calls.
This page took 0.02615 seconds and 4 git commands to generate.