gdb: Convert language la_print_type field to a method
[deliverable/binutils-gdb.git] / gdb / rust-lang.c
index d75f34d0d9a4c39019540086046be4bbe7507703..f78686ae1c8d0b70d5b2139492ad01a09a46aa63 100644 (file)
@@ -951,16 +951,6 @@ rust_internal_print_type (struct type *type, const char *varstring,
     }
 }
 
-static void
-rust_print_type (struct type *type, const char *varstring,
-                struct ui_file *stream, int show, int level,
-                const struct type_print_options *flags)
-{
-  print_offset_data podata;
-  rust_internal_print_type (type, varstring, stream, show, level,
-                           flags, false, &podata);
-}
-
 \f
 
 /* Like arch_composite_type, but uses TYPE to decide how to allocate
@@ -2063,7 +2053,6 @@ extern const struct language_data rust_language_data =
   rust_printchar,              /* Print a character constant */
   rust_printstr,               /* Function to print string constant */
   rust_emitchar,               /* Print a single char */
-  rust_print_type,             /* Print a type using appropriate syntax */
   rust_print_typedef,          /* Print a typedef using appropriate syntax */
   rust_value_print_inner,      /* la_value_print_inner */
   c_value_print,               /* Print a top-level value */
@@ -2144,6 +2133,17 @@ public:
     *demangled = gdb_demangle (mangled, DMGL_PARAMS | DMGL_ANSI);
     return *demangled != NULL;
   }
+
+  /* See language.h.  */
+
+  void print_type (struct type *type, const char *varstring,
+                  struct ui_file *stream, int show, int level,
+                  const struct type_print_options *flags) const override
+  {
+    print_offset_data podata;
+    rust_internal_print_type (type, varstring, stream, show, level,
+                             flags, false, &podata);
+  }
 };
 
 /* Single instance of the Rust language class.  */
This page took 0.023401 seconds and 4 git commands to generate.