diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-05-01 21:20:06 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-06-02 13:53:10 +0100 |
commit | 48448202d7e607d7423c6186438099f442732a95 (patch) | |
tree | 0427207c92ceb8622bc9930281964432a8efd4c6 /gdb/language.h | |
parent | 15e5fd35569d555ca53f074c571d4a3d06da67b0 (diff) | |
download | gdb-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/language.h')
-rw-r--r-- | gdb/language.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/gdb/language.h b/gdb/language.h index 56260fb..cc0d0ff 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -372,11 +372,6 @@ struct language_data void (*la_language_arch_info) (struct gdbarch *, struct language_arch_info *); - /* Return information about whether TYPE should be passed - (and returned) by reference at the language level. */ - struct language_pass_by_ref_info (*la_pass_by_reference) - (struct type *type); - /* Return an expression that can be used for a location watchpoint. TYPE is a pointer type that points to the memory to watch, and ADDR is the address of the watched memory. */ @@ -497,6 +492,17 @@ struct language_defn : language_data const struct block *var_block, struct frame_info *frame) const; + /* Return information about whether TYPE should be passed + (and returned) by reference at the language level. The default + implementation returns a LANGUAGE_PASS_BY_REF_INFO initialised in its + default state. */ + + virtual struct language_pass_by_ref_info pass_by_reference_info + (struct type *type) const + { + return {}; + } + /* List of all known languages. */ static const struct language_defn *languages[nr_languages]; }; @@ -669,11 +675,6 @@ extern const char *default_word_break_characters (void); (and returned) by reference at the language level. */ struct language_pass_by_ref_info language_pass_by_reference (struct type *type); -/* Return a default struct that provides pass-by-reference information - about the given TYPE. Languages should update the default values - as appropriate. */ -struct language_pass_by_ref_info default_pass_by_reference (struct type *type); - /* The default implementation of la_print_typedef. */ void default_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); |