From 7d93a1e0b6af703c75daa93456608f8bb5f34f13 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sat, 16 May 2020 12:16:06 -0400 Subject: gdb: remove TYPE_NAME macro Remove `TYPE_NAME`, changing all the call sites to use `type::name` directly. This is quite a big diff, but this was mostly done using sed and coccinelle. A few call sites were done by hand. gdb/ChangeLog: * gdbtypes.h (TYPE_NAME): Remove. Change all cal sites to use type::name instead. --- gdb/c-valprint.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gdb/c-valprint.c') diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index d117248..7d5feb3 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -78,7 +78,7 @@ c_textual_element_type (struct type *type, char format) while (iter_type) { /* Check the name of the type. */ - if (TYPE_NAME (iter_type) && textual_name (TYPE_NAME (iter_type))) + if (iter_type->name () && textual_name (iter_type->name ())) return 1; if (iter_type->code () != TYPE_CODE_TYPEDEF) @@ -521,11 +521,11 @@ c_value_print (struct value *val, struct ui_file *stream, (Don't use c_textual_element_type here; quoted strings are always exactly (char *), (wchar_t *), or the like. */ if (original_type->code () == TYPE_CODE_PTR - && TYPE_NAME (original_type) == NULL - && TYPE_NAME (TYPE_TARGET_TYPE (original_type)) != NULL - && (strcmp (TYPE_NAME (TYPE_TARGET_TYPE (original_type)), + && original_type->name () == NULL + && TYPE_TARGET_TYPE (original_type)->name () != NULL + && (strcmp (TYPE_TARGET_TYPE (original_type)->name (), "char") == 0 - || textual_name (TYPE_NAME (TYPE_TARGET_TYPE (original_type))))) + || textual_name (TYPE_TARGET_TYPE (original_type)->name ()))) { /* Print nothing. */ } @@ -598,14 +598,14 @@ c_value_print (struct value *val, struct ui_file *stream, < TYPE_LENGTH (value_enclosing_type (val))))) val = value_cast (real_type, val); fprintf_filtered (stream, "(%s%s) ", - TYPE_NAME (real_type), + real_type->name (), full ? "" : _(" [incomplete object]")); } else if (type != check_typedef (value_enclosing_type (val))) { /* No RTTI information, so let's do our best. */ fprintf_filtered (stream, "(%s ?) ", - TYPE_NAME (value_enclosing_type (val))); + value_enclosing_type (val)->name ()); val = value_cast (value_enclosing_type (val), val); } } -- cgit v1.1