]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: Convert language la_lookup_transparent_type field to a method
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 1 May 2020 21:12:12 +0000 (22:12 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 2 Jun 2020 12:53:10 +0000 (13:53 +0100)
This commit changes the language_data::la_lookup_transparent_type
function pointer member variable into a member function of
language_defn.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* ada-lang.c (ada_language_data): Delete
la_lookup_transparent_type initializer.
* c-lang.c (c_language_data): Likewise.
(cplus_language_data): Likewise.
(cplus_language::lookup_transparent_type): New member function.
(asm_language_data): Delete la_lookup_transparent_type
initializer.
(minimal_language_data): Likewise.
* d-lang.c (d_language_data): Likewise.
* f-lang.c (f_language_data): Likewise.
* go-lang.c (go_language_data): Likewise.
* language.c (unknown_language_data): Likewise.
(auto_language_data): Likewise.
* language.h (struct language_data): Delete
la_lookup_transparent_type field.
(language_defn::lookup_transparent_type): New member function.
* m2-lang.c (m2_language_data): Delete la_lookup_transparent_type
initializer.
* objc-lang.c (objc_language_data): Likewise.
* opencl-lang.c (opencl_language_data): Likewise.
* p-lang.c (pascal_language_data): Likewise.
* rust-lang.c (rust_language_data): Likewise.
* symtab.c (symbol_matches_domain): Update call.

14 files changed:
gdb/ChangeLog
gdb/ada-lang.c
gdb/c-lang.c
gdb/d-lang.c
gdb/f-lang.c
gdb/go-lang.c
gdb/language.c
gdb/language.h
gdb/m2-lang.c
gdb/objc-lang.c
gdb/opencl-lang.c
gdb/p-lang.c
gdb/rust-lang.c
gdb/symtab.c

index 4a0dbd1c3d32ca0bf0241711c2b7cd590ad53ff3..d10a0db9c04ff46e309a424717636feaf7c62c3b 100644 (file)
@@ -1,3 +1,29 @@
+2020-06-02  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * ada-lang.c (ada_language_data): Delete
+       la_lookup_transparent_type initializer.
+       * c-lang.c (c_language_data): Likewise.
+       (cplus_language_data): Likewise.
+       (cplus_language::lookup_transparent_type): New member function.
+       (asm_language_data): Delete la_lookup_transparent_type
+       initializer.
+       (minimal_language_data): Likewise.
+       * d-lang.c (d_language_data): Likewise.
+       * f-lang.c (f_language_data): Likewise.
+       * go-lang.c (go_language_data): Likewise.
+       * language.c (unknown_language_data): Likewise.
+       (auto_language_data): Likewise.
+       * language.h (struct language_data): Delete
+       la_lookup_transparent_type field.
+       (language_defn::lookup_transparent_type): New member function.
+       * m2-lang.c (m2_language_data): Delete la_lookup_transparent_type
+       initializer.
+       * objc-lang.c (objc_language_data): Likewise.
+       * opencl-lang.c (opencl_language_data): Likewise.
+       * p-lang.c (pascal_language_data): Likewise.
+       * rust-lang.c (rust_language_data): Likewise.
+       * symtab.c (symbol_matches_domain): Update call.
+
 2020-06-02  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * ada-lang.c (ada_language_arch_info): Delete function, move
index a1cd04b015c4e4a6d6f008e55feb5495d973f1b4..7d23fd5d12309ea7fe4572f2dce05f6328d7ce14 100644 (file)
@@ -13988,7 +13988,6 @@ extern const struct language_data ada_language_data =
   NULL,                         /* name_of_this */
   true,                         /* la_store_sym_names_in_linkage_form_p */
   ada_lookup_symbol_nonlocal,   /* Looking up non-local symbols.  */
-  basic_lookup_transparent_type,        /* lookup_transparent_type */
   ada_la_decode,                /* Language specific symbol demangler */
   ada_sniff_from_mangled_name,
   NULL,                         /* Language specific
index e82d058777ed9ff2a15f1ff167feb278c7a96bd0..aa1efa0d806481e98fe83774419538d97d75a9d9 100644 (file)
@@ -911,7 +911,6 @@ extern const struct language_data c_language_data =
   NULL,                                /* name_of_this */
   true,                                /* la_store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,                                /* Language specific symbol demangler */
   NULL,
   NULL,                                /* Language specific
@@ -1012,7 +1011,6 @@ extern const struct language_data cplus_language_data =
   "this",                       /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
   cp_lookup_symbol_nonlocal,   /* lookup_symbol_nonlocal */
-  cp_lookup_transparent_type,   /* lookup_transparent_type */
   gdb_demangle,                        /* Language specific symbol demangler */
   gdb_sniff_from_mangled_name,
   cp_class_name_from_physname,  /* Language specific
@@ -1112,6 +1110,12 @@ public:
     lai->bool_type_symbol = "bool";
     lai->bool_type_default = builtin->builtin_bool;
   }
+
+  /* See language.h.  */
+  struct type *lookup_transparent_type (const char *name) const override
+  {
+    return cp_lookup_transparent_type (name);
+  }
 };
 
 /* The single instance of the C++ language class.  */
@@ -1149,7 +1153,6 @@ extern const struct language_data asm_language_data =
   NULL,                                /* name_of_this */
   true,                                /* la_store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,                                /* Language specific symbol demangler */
   NULL,
   NULL,                                /* Language specific
@@ -1221,7 +1224,6 @@ extern const struct language_data minimal_language_data =
   NULL,                                /* name_of_this */
   true,                                /* la_store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   NULL,                                /* Language specific symbol demangler */
   NULL,
   NULL,                                /* Language specific
index 778d77313c9d30263af5ae453dc163acb6b8f19e..8c4ee44ac97f84bcdc70ccd83605618478ca203c 100644 (file)
@@ -165,7 +165,6 @@ extern const struct language_data d_language_data =
   "this",
   false,                       /* la_store_sym_names_in_linkage_form_p */
   d_lookup_symbol_nonlocal,
-  basic_lookup_transparent_type,
   d_demangle,                  /* Language specific symbol demangler.  */
   d_sniff_from_mangled_name,
   NULL,                                /* Language specific
index 1eeb5070deec1e2bf586f1b389d9657b1e8d016e..32435fa856a7b373d5c164845d2ffc302fcaeefe 100644 (file)
@@ -616,7 +616,6 @@ extern const struct language_data f_language_data =
   NULL,                        /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
   cp_lookup_symbol_nonlocal,   /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
 
   /* We could support demangling here to provide module namespaces
      also for inferiors with only minimal symbol table (ELF symbols).
index 7340a334e66dc387d54c05ac77f3ba5fef107eee..22dd02f10be826f65e3df640737cb0dee8a51499 100644 (file)
@@ -550,7 +550,6 @@ extern const struct language_data go_language_data =
   NULL,                                /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal, 
-  basic_lookup_transparent_type,
   go_demangle,                 /* Language specific symbol demangler.  */
   go_sniff_from_mangled_name,
   NULL,                                /* Language specific
index bc714ba85bd32cfa73a918f54d42cdfb2f467b9c..227f26bc878e62c50547c916ea4691a003c2d8c0 100644 (file)
@@ -827,7 +827,6 @@ extern const struct language_data unknown_language_data =
   "this",                      /* name_of_this */
   true,                                /* store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,           /* Language specific symbol demangler */
   NULL,
   unk_lang_class_name,         /* Language specific
@@ -895,7 +894,6 @@ extern const struct language_data auto_language_data =
   "this",                      /* name_of_this */
   false,                       /* store_sym_names_in_linkage_form_p */
   basic_lookup_symbol_nonlocal,        /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   unk_lang_demangle,           /* Language specific symbol demangler */
   NULL,
   unk_lang_class_name,         /* Language specific
index 4cf16c11540f88b9abba11f64703b2849399ea9f..505600aa957d7b02bdf262c63885a30b0bba53fe 100644 (file)
@@ -315,9 +315,6 @@ struct language_data
        const struct block *,
        const domain_enum);
 
-    /* Find the definition of the type with the given name.  */
-    struct type *(*la_lookup_transparent_type) (const char *);
-
     /* Return demangled language symbol, or NULL.  */
     char *(*la_demangle) (const char *mangled, int options);
 
@@ -504,6 +501,13 @@ struct language_defn : language_data
   virtual void language_arch_info (struct gdbarch *,
                                   struct language_arch_info *) const = 0;
 
+  /* Find the definition of the type with the given name.  */
+
+  virtual struct type *lookup_transparent_type (const char *name) const
+  {
+    return basic_lookup_transparent_type (name);
+  }
+
   /* List of all known languages.  */
   static const struct language_defn *languages[nr_languages];
 };
index 16738e1b7e96d884efcb8fa8d02a1dbc5fd2aba5..9ce6f2a9e6819bf37e0b39f3e21e553e9c310de6 100644 (file)
@@ -375,7 +375,6 @@ extern const struct language_data m2_language_data =
   NULL,                                /* 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 */
   NULL,                                /* Language specific symbol demangler */
   NULL,
   NULL,                                /* Language specific
index 87e5e681ec432ffb6797c6561f654f706defc10f..040226c81d5a971a7f14f4d3bc741b8aca56bf64 100644 (file)
@@ -390,7 +390,6 @@ extern const struct language_data objc_language_data =
   "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
index e8e5e8e04e33c75e183da7a4eabb7933f0b0edb3..1c41ffd82273f5a84d2d2d1a67ce1d6bcb0e5c97 100644 (file)
@@ -1050,7 +1050,6 @@ extern const struct language_data opencl_language_data =
   NULL,                         /* 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 */
   NULL,                                /* Language specific symbol demangler */
   NULL,
   NULL,                                /* Language specific
index 4c13867446b3a05e139e6f881ac36768523ee4ca..d2d8b5e9d16f7bb4e818573171b4134d4b89339e 100644 (file)
@@ -406,7 +406,6 @@ extern const struct language_data pascal_language_data =
   "this",                      /* 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 */
   NULL,                                /* Language specific symbol demangler */
   NULL,
   NULL,                                /* Language specific class_name_from_physname */
index dd8558a3fc8a883f4d2c5892c1ed0da59370a30a..65f2324b671e98999f917bc6ead0d9eb4a82ab3c 100644 (file)
@@ -2082,7 +2082,6 @@ extern const struct language_data rust_language_data =
   NULL,                                /* name_of_this */
   false,                       /* la_store_sym_names_in_linkage_form_p */
   rust_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
-  basic_lookup_transparent_type,/* lookup_transparent_type */
   gdb_demangle,                        /* Language specific symbol demangler */
   rust_sniff_from_mangled_name,
   NULL,                                /* Language specific
index 5c4e282c0246262d0f9d5de74a35c2a0fadcb812..f333ea6c34fa3701df5a3941305b80b1ad559b45 100644 (file)
@@ -2722,7 +2722,7 @@ symbol_matches_domain (enum language symbol_language,
 struct type *
 lookup_transparent_type (const char *name)
 {
-  return current_language->la_lookup_transparent_type (name);
+  return current_language->lookup_transparent_type (name);
 }
 
 /* A helper for basic_lookup_transparent_type that interfaces with the