+2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * 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.
+
2020-06-02 Andrew Burgess <andrew.burgess@embecosm.com>
* ada-lang.c (ada_read_var_value): Delete function, move
ada_get_gdb_completer_word_break_characters,
ada_collect_symbol_completion_matches,
ada_language_arch_info,
- default_pass_by_reference,
ada_watch_location_expression,
ada_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
ada_iterate_over_symbols,
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,
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,
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. */
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,
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,
cp_pass_by_reference (struct type *type)
{
if ((current_cp_abi.pass_by_reference) == NULL)
- return default_pass_by_reference (type);
+ return {};
return (*current_cp_abi.pass_by_reference) (type);
}
default_word_break_characters,
default_collect_symbol_completion_matches,
d_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
f_word_break_characters,
f_collect_symbol_completion_matches,
f_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
cp_get_symbol_name_matcher, /* la_get_symbol_name_matcher */
iterate_over_symbols,
type = check_typedef (type);
/* Start with the default values. */
- struct language_pass_by_ref_info info
- = default_pass_by_reference (type);
+ struct language_pass_by_ref_info info;
bool has_cc_attr = false;
bool is_pass_by_value = false;
default_word_break_characters,
default_collect_symbol_completion_matches,
go_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
struct language_pass_by_ref_info
language_pass_by_reference (struct type *type)
{
- return current_language->la_pass_by_reference (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)
-{
- return {};
+ return current_language->pass_by_reference_info (type);
}
/* Return the default string containing the list of characters
default_word_break_characters,
default_collect_symbol_completion_matches,
unknown_language_arch_info, /* la_language_arch_info. */
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
default_word_break_characters,
default_collect_symbol_completion_matches,
unknown_language_arch_info, /* la_language_arch_info. */
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
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. */
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];
};
(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);
default_word_break_characters,
default_collect_symbol_completion_matches,
m2_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
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,
default_word_break_characters,
default_collect_symbol_completion_matches,
opencl_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,
default_word_break_characters,
default_collect_symbol_completion_matches,
pascal_language_arch_info,
- default_pass_by_reference,
c_watch_location_expression,
NULL, /* la_compare_symbol_for_completion */
iterate_over_symbols,
default_word_break_characters,
default_collect_symbol_completion_matches,
rust_language_arch_info,
- default_pass_by_reference,
rust_watch_location_expression,
NULL, /* la_get_symbol_name_matcher */
iterate_over_symbols,