aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2020-05-01 21:20:06 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2020-06-02 13:53:10 +0100
commit48448202d7e607d7423c6186438099f442732a95 (patch)
tree0427207c92ceb8622bc9930281964432a8efd4c6 /gdb/c-lang.c
parent15e5fd35569d555ca53f074c571d4a3d06da67b0 (diff)
downloadgdb-48448202d7e607d7423c6186438099f442732a95.zip
gdb-48448202d7e607d7423c6186438099f442732a95.tar.gz
gdb-48448202d7e607d7423c6186438099f442732a95.tar.bz2
gdb: Convert language la_pass_by_reference field to a method
This commit changes the language_data::la_pass_by_reference function pointer member variable into a member function of language_defn. The interesting thing in this commit is that I have removed the default_pass_by_reference function entirely. This function only ever returned a language_pass_by_ref_info struct in its default state, so all uses of this function can be replaced by just default initialisation of a language_pass_by_ref_info variable. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Delete la_pass_by_reference initializer. * c-lang.c (c_language_data): Likewise. (cplus_language_data): Likewise. (cplus_language::pass_by_reference_info): New method. (asm_language_data): Delete la_pass_by_reference initializer. (minimal_language_data): Likewise. * cp-abi.c (cp_pass_by_reference): Remove use of default_pass_by_reference. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_language_data): Likewise. * gnu-v3-abi.c (gnuv3_pass_by_reference): Remove use of default_pass_by_reference. * go-lang.c (go_language_data): Likewise. * language.c (language_pass_by_reference): Update. (default_pass_by_reference): Delete. (unknown_language_data): Delete la_pass_by_reference initializer. (auto_language_data): Likewise. * language.h (struct language_data): Delete la_pass_by_reference field. (language_defn::pass_by_reference_info): New member function. (default_pass_by_reference): Delete declaration. * m2-lang.c (m2_language_data): Delete la_pass_by_reference 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.
Diffstat (limited to 'gdb/c-lang.c')
-rw-r--r--gdb/c-lang.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 8663dc1..9efcf56 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -922,7 +922,6 @@ extern const struct language_data c_language_data =
default_word_break_characters,
default_collect_symbol_completion_matches,
c_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
@@ -1081,7 +1080,6 @@ extern const struct language_data cplus_language_data =
default_word_break_characters,
default_collect_symbol_completion_matches,
cplus_language_arch_info,
- cp_pass_by_reference,
c_watch_location_expression,
cp_get_symbol_name_matcher,
iterate_over_symbols,
@@ -1101,6 +1099,14 @@ public:
cplus_language ()
: language_defn (language_cplus, cplus_language_data)
{ /* Nothing. */ }
+
+ /* See language.h. */
+
+ struct language_pass_by_ref_info pass_by_reference_info
+ (struct type *type) const override
+ {
+ return cp_pass_by_reference (type);
+ }
};
/* The single instance of the C++ language class. */
@@ -1149,7 +1155,6 @@ extern const struct language_data asm_language_data =
default_word_break_characters,
default_collect_symbol_completion_matches,
c_language_arch_info, /* FIXME: la_language_arch_info. */
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
@@ -1214,7 +1219,6 @@ extern const struct language_data minimal_language_data =
default_word_break_characters,
default_collect_symbol_completion_matches,
c_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,