From 67bd3fd5e4d1bf9f1730eaf6ed9fa9df89904fc2 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Sat, 4 Jul 2020 09:06:08 +0100 Subject: gdb: Convert language_data::c_style_arrays to a method Convert language_data::c_style_arrays member variable to a virtual method language_defn::c_style_arrays_p. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Remove c_style_arrays initializer. (ada_language::c_style_arrays_p): New member fuction. * c-lang.c (c_language_data): Remove c_style_arrays initializer. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * eval.c (ptrmath_type_p): Update call to c_style_arrays_p. * f-lang.c (f_language_data): Remove c_style_arrays initializer. (f_language::c_style_arrays_p): New member function. * go-lang.c (go_language_data): Remove c_style_arrays initializer. * infcall.c (value_arg_coerce): Update call to c_style_arrays_p. * language.c (unknown_language_data): Remove c_style_arrays initializer. (auto_language_data): Likewise. * language.h (language_data): Remove c_style_arrays field. (language_defn::c_style_arrays_p): New member function. * m2-lang.c (m2_language_data): Remove c_style_arrays initializer. (m2_language::c_style_arrays_p): New member function. * objc-lang.c (objc_language_data): Remove c_style_arrays initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_language_data): Likewise. * rust-lang.c (rust_language_data): Likewise. * valarith.c (value_subscript): Update call to c_style_arrays_p, and update local variable to a bool. * valops.c (value_cast): Update call to c_style_arrays_p. (value_array): Likewise. * value.c (coerce_array): Likewise. --- gdb/m2-lang.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/m2-lang.c') diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 94340b0..9dd5577 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -206,7 +206,6 @@ extern const struct language_data m2_language_data = &exp_descriptor_modula2, false, /* la_store_sym_names_in_linkage_form_p */ m2_op_print_tab, /* expression operators for printing */ - 0, /* arrays are first-class (not c-style) */ 0, /* String lower bound */ &default_varobj_ops, }; @@ -436,6 +435,11 @@ public: return false; } + + /* See language.h. */ + + bool c_style_arrays_p () const override + { return false; } }; /* Single instance of the M2 language. */ -- cgit v1.1