mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-02 20:53:06 +08:00
gdb: Convert language la_is_string_type_p field to a method
This commit changes the language_data::la_is_string_type_p function pointer member variable into a member function of language_defn. There should be no user visible changes after this commit. gdb/ChangeLog: * ada-lang.c (ada_language_data): Delete la_is_string_type_p initializer. (ada_language::is_string_type_p): New member function. * c-lang.c (c_language_data): Delete la_is_string_type_p initializer. (cplus_language_data): Likewise. (asm_language_data): Likewise. (minimal_language_data): Likewise. * d-lang.c (d_language_data): Likewise. * f-lang.c (f_is_string_type_p): Delete function, implementation moved to f_language::is_string_type_p. (f_language_data): Delete la_is_string_type_p initializer. (f_language::is_string_type_p): New member function, implementation from f_is_string_type_p. * go-lang.c (go_is_string_type_p): Delete function, implementation moved to go_language::is_string_type_p. (go_language_data): Delete la_is_string_type_p initializer. (go_language::is_string_type_p): New member function, implementation from go_is_string_type_p. * language.c (language_defn::is_string_type_p): Define new member function. (default_is_string_type_p): Make static, add comment copied from header file. (unknown_language_data): Delete la_is_string_type_p initializer. (unknown_language::is_string_type_p): New member function. (auto_language_data): Delete la_is_string_type_p initializer. (auto_language::is_string_type_p): New member function. * language.h (language_data): Delete la_is_string_type_p field. (language_defn::is_string_type_p): Declare new function. (default_is_string_type_p): Delete desclaration, move comment to definition. * m2-lang.c (m2_is_string_type_p): Delete function, implementation moved to m2_language::is_string_type_p. (m2_language_data): Delete la_is_string_type_p initializer. (m2_language::is_string_type_p): New member function, implementation from m2_is_string_type_p. * objc-lang.c (objc_language_data): Delete la_is_string_type_p initializer. * opencl-lang.c (opencl_language_data): Likewise. * p-lang.c (pascal_is_string_type_p): Delete function, implementation moved to pascal_language::is_string_type_p. (pascal_language_data): Delete la_is_string_type_p initializer. (pascal_language::is_string_type_p): New member function, implementation from pascal_is_string_type_p. * rust-lang.c (rust_is_string_type_p): Delete function, implementation moved to rust_language::is_string_type_p. (rust_language_data): Delete la_is_string_type_p initializer. (rust_language::is_string_type_p): New member function, implementation from rust_is_string_type_p. * valprint.c (val_print_scalar_or_string_type_p): Update call to is_string_type_p.
This commit is contained in:
18
gdb/p-lang.c
18
gdb/p-lang.c
@ -152,16 +152,6 @@ is_pascal_string_type (struct type *type,int *length_pos,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* This is a wrapper around IS_PASCAL_STRING_TYPE that returns true if TYPE
|
||||
is a string. */
|
||||
|
||||
static bool
|
||||
pascal_is_string_type_p (struct type *type)
|
||||
{
|
||||
return is_pascal_string_type (type, nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr) > 0;
|
||||
}
|
||||
|
||||
static void pascal_one_char (int, struct ui_file *, int *);
|
||||
|
||||
/* Print the character C on STREAM as part of the contents of a literal
|
||||
@ -282,7 +272,6 @@ extern const struct language_data pascal_language_data =
|
||||
1, /* c-style arrays */
|
||||
0, /* String lower bound */
|
||||
&default_varobj_ops,
|
||||
pascal_is_string_type_p,
|
||||
"{...}" /* la_struct_too_deep_ellipsis */
|
||||
};
|
||||
|
||||
@ -502,6 +491,13 @@ public:
|
||||
pascal_print_typedef (type, new_symbol, stream);
|
||||
}
|
||||
|
||||
/* See language.h. */
|
||||
|
||||
bool is_string_type_p (struct type *type) const override
|
||||
{
|
||||
return is_pascal_string_type (type, nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr) > 0;
|
||||
}
|
||||
};
|
||||
|
||||
/* Single instance of the Pascal language class. */
|
||||
|
Reference in New Issue
Block a user