mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-19 00:59:15 +08:00
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.
This commit is contained in:
@ -232,11 +232,6 @@ struct language_data
|
||||
|
||||
const struct op_print *la_op_print_tab;
|
||||
|
||||
/* Zero if the language has first-class arrays. True if there are no
|
||||
array values, and array objects decay to pointers, as in C. */
|
||||
|
||||
char c_style_arrays;
|
||||
|
||||
/* Index to use for extracting the first element of a string. */
|
||||
char string_lower_bound;
|
||||
|
||||
@ -565,6 +560,14 @@ struct language_defn : language_data
|
||||
virtual const char *name_of_this () const
|
||||
{ return nullptr; }
|
||||
|
||||
/* Return false if the language has first-class arrays. Return true if
|
||||
there are no array values, and array objects decay to pointers, as in
|
||||
C. The default is true as currently most supported languages behave
|
||||
in this manor. */
|
||||
|
||||
virtual bool c_style_arrays_p () const
|
||||
{ return true; }
|
||||
|
||||
protected:
|
||||
|
||||
/* This is the overridable part of the GET_SYMBOL_NAME_MATCHER method.
|
||||
|
Reference in New Issue
Block a user