gdb: Merge auto and unknown language implementations
authorAndrew Burgess <andrew.burgess@embecosm.com>
Thu, 6 Aug 2020 10:14:37 +0000 (11:14 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 23 Oct 2020 09:57:13 +0000 (10:57 +0100)
commitb01175fc46bbb9103bde88ec93236bcb6719c696
tree99cd85540b79968319d8579877bb98c200c57133
parenta948551942824947baaf6a077745fb5480d264a7
gdb: Merge auto and unknown language implementations

The auto_language and unknown_language classes are basically the same
except for the language names and store_sym_names_in_linkage_form_p
which the unknown_language overrides to return true, while
auto_language returns the default false.

This commit creates a new parent class from which both of these
languages can inherit.  The two base classes are now greatly reduced.

Some of the static helper functions which previously were called from
both of these languages are now only called from one place, and so
I've inlined them into the new class.

There should be no user visible changes after this commit.

gdb/ChangeLog:

* language.c (default_is_string_type_p): Delete, implementation
moved into auto_or_unknown_language::is_string_type_p.
(unk_op_print_tab): Moved into
auto_or_unknown_language::opcode_print_table.
(unknown_language_arch_info): Delete, implementation moved into
auto_or_unknown_language::language_arch_info.
(class auto_or_unknown_language): New class, member functions
copied from unknown_language class, with some updates.
(class unknown_language): Most member functions moved into
auto_or_unknown_language class.  Inherit from
auto_or_unknown_language class.
(class auto_language): Inherit from auto_or_unknown_language.
Delete most member functions.
gdb/ChangeLog
gdb/language.c