+2018-06-01 Tom Tromey <tom@tromey.com>
+
+ * valops.c (value_cast_structs, destructor_name_p): Update.
+ * symtab.c (gdb_mangle_name): Update.
+ * stabsread.c (define_symbol, read_cpp_abbrev, read_baseclasses):
+ Update.
+ * p-valprint.c (pascal_object_is_vtbl_ptr_type)
+ (pascal_object_print_value_fields, pascal_object_print_value):
+ Update.
+ * p-typeprint.c (pascal_type_print_derivation_info): Update.
+ * linespec.c (find_methods): Update.
+ * gdbtypes.h (type_name_no_tag): Remove.
+ (type_name_or_error): Rename from type_name_no_tag_or_error.
+ * gdbtypes.c (type_name_no_tag): Remove.
+ (type_name_or_error): Rename from type_name_no_tag_or_error.
+ (lookup_struct_elt_type, check_typedef): Update.
+ * expprint.c (print_subexp_standard): Update.
+ * dwarf2read.c (dwarf2_add_field, load_partial_dies): Update.
+ * d-namespace.c (d_lookup_nested_symbol): Update.
+ * cp-valprint.c (cp_is_vtbl_ptr_type, cp_print_value_fields)
+ (cp_print_class_member): Update.
+ * cp-namespace.c (cp_lookup_nested_symbol): Update.
+ * completer.c (add_struct_fields): Update.
+ * c-typeprint.c (cp_type_print_derivation_info)
+ (c_type_print_varspec_prefix, c_type_print_base_struct_union):
+ Update.
+ * ada-lang.c (parse_old_style_renaming, xget_renaming_scope)
+ (ada_prefer_type, ada_is_exception_sym): Update.
+
2018-06-01 Tom Tromey <tom@tromey.com>
* valops.c (enum_constant_from_type, value_namespace_elt)
|| TYPE_NFIELDS (type) != 1)
return ADA_NOT_RENAMING;
- name = type_name_no_tag (type);
+ name = TYPE_NAME (type);
if (name == NULL)
return ADA_NOT_RENAMING;
So, to extract the scope, we search for the "___XR" extension,
and then backtrack until we find the first "__". */
- const char *name = type_name_no_tag (renaming_type);
+ const char *name = TYPE_NAME (renaming_type);
const char *suffix = strstr (name, "___XR");
const char *last;
return 1;
else
{
- const char *type0_name = type_name_no_tag (type0);
- const char *type1_name = type_name_no_tag (type1);
+ const char *type0_name = TYPE_NAME (type0);
+ const char *type1_name = TYPE_NAME (type1);
if (type0_name != NULL && strstr (type0_name, "___XR") != NULL
&& (type1_name == NULL || strstr (type1_name, "___XR") == NULL))
static int
ada_is_exception_sym (struct symbol *sym)
{
- const char *type_name = type_name_no_tag (SYMBOL_TYPE (sym));
+ const char *type_name = TYPE_NAME (SYMBOL_TYPE (sym));
return (SYMBOL_CLASS (sym) != LOC_TYPEDEF
&& SYMBOL_CLASS (sym) != LOC_BLOCK
? "public" : (TYPE_FIELD_PROTECTED (type, i)
? "protected" : "private"),
BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
- name = type_name_no_tag (TYPE_BASECLASS (type, i));
+ name = TYPE_NAME (TYPE_BASECLASS (type, i));
if (name)
print_name_maybe_canonical (name, flags, stream);
else
case TYPE_CODE_MEMBERPTR:
c_type_print_varspec_prefix (TYPE_TARGET_TYPE (type),
- stream, show, 0, 0, language, flags,
- podata);
- name = type_name_no_tag (TYPE_SELF_TYPE (type));
+ stream, show, 0, 0, language, flags, podata);
+ name = TYPE_NAME (TYPE_SELF_TYPE (type));
if (name)
print_name_maybe_canonical (name, flags, stream);
else
stream, show, 0, 0, language, flags,
podata);
fprintf_filtered (stream, "(");
- name = type_name_no_tag (TYPE_SELF_TYPE (type));
+ name = TYPE_NAME (TYPE_SELF_TYPE (type));
if (name)
print_name_maybe_canonical (name, flags, stream);
else
struct fn_field *f = TYPE_FN_FIELDLIST1 (type, i);
int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
const char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
- const char *name = type_name_no_tag (type);
+ const char *name = TYPE_NAME (type);
int is_constructor = name && strcmp (method_name,
name) == 0;
{
if (!computed_type_name)
{
- type_name = type_name_no_tag (type);
+ type_name = TYPE_NAME (type);
computed_type_name = 1;
}
/* Omit constructors from the completion list. */
const struct block *block,
const domain_enum domain)
{
- /* type_name_no_tag_or_error provides better error reporting using the
+ /* type_name_or_error provides better error reporting using the
original type. */
struct type *saved_parent_type = parent_type;
if (symbol_lookup_debug)
{
- const char *type_name = type_name_no_tag (saved_parent_type);
+ const char *type_name = TYPE_NAME (saved_parent_type);
fprintf_unfiltered (gdb_stdlog,
"cp_lookup_nested_symbol (%s, %s, %s, %s)\n",
case TYPE_CODE_MODULE:
{
int size;
- const char *parent_name = type_name_no_tag_or_error (saved_parent_type);
+ const char *parent_name = type_name_or_error (saved_parent_type);
struct block_symbol sym;
char *concatenated_name;
int is_in_anonymous;
int
cp_is_vtbl_ptr_type (struct type *type)
{
- const char *type_name = type_name_no_tag (type);
+ const char *type_name = TYPE_NAME (type);
return (type_name != NULL && !strcmp (type_name, vtbl_ptr_name));
}
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
fputs_filtered ("members of ", stream);
- fputs_filtered (type_name_no_tag (type), stream);
+ fputs_filtered (TYPE_NAME (type), stream);
fputs_filtered (": ", stream);
}
}
const char *name;
fputs_filtered (prefix, stream);
- name = type_name_no_tag (self_type);
+ name = TYPE_NAME (self_type);
if (name)
fputs_filtered (name, stream);
else
case TYPE_CODE_MODULE:
{
int size;
- const char *parent_name = type_name_no_tag_or_error (saved_parent_type);
+ const char *parent_name = type_name_or_error (saved_parent_type);
struct block_symbol sym
= d_lookup_symbol_in_module (parent_name, nested_name,
block, VAR_DOMAIN, 0);
SET_FIELD_BITPOS (*fp, offset * bits_per_byte);
FIELD_BITSIZE (*fp) = 0;
FIELD_TYPE (*fp) = die_type (die, cu);
- FIELD_NAME (*fp) = type_name_no_tag (fp->type);
+ FIELD_NAME (*fp) = TYPE_NAME (fp->type);
}
else if (die->tag == DW_TAG_variant_part)
{
/* The exception for DW_TAG_typedef with has_children above is
a workaround of GCC PR debug/47510. In the case of this complaint
- type_name_no_tag_or_error will error on such types later.
+ type_name_or_error will error on such types later.
GDB skipped children of DW_TAG_typedef by the shortcut above and then
it could not find the child DIEs referenced later, this is checked
case OP_SCOPE:
myprec = PREC_PREFIX;
assoc = 0;
- fputs_filtered (type_name_no_tag (exp->elts[pc + 1].type), stream);
+ fputs_filtered (TYPE_NAME (exp->elts[pc + 1].type), stream);
fputs_filtered ("::", stream);
nargs = longest_to_int (exp->elts[pc + 2].longconst);
(*pos) += 4 + BYTES_TO_EXP_ELEM (nargs + 1);
TYPE_LENGTH (type) = 1; /* In practice, this is never needed. */
}
-/* Return a typename for a struct/union/enum type without "struct ",
- "union ", or "enum ". If the type has a NULL name, return NULL. */
-
-const char *
-type_name_no_tag (const struct type *type)
-{
- return TYPE_NAME (type);
-}
-
-/* A wrapper of type_name_no_tag which calls error if the type is anonymous.
+/* A wrapper of TYPE_NAME which calls error if the type is anonymous.
Since GCC PR debug/47510 DWARF provides associated information to detect the
anonymous class linkage name from its typedef.
apply it itself. */
const char *
-type_name_no_tag_or_error (struct type *type)
+type_name_or_error (struct type *type)
{
struct type *saved_type = type;
const char *name;
type = check_typedef (type);
- name = type_name_no_tag (type);
+ name = TYPE_NAME (type);
if (name != NULL)
return name;
- name = type_name_no_tag (saved_type);
+ name = TYPE_NAME (saved_type);
objfile = TYPE_OBJFILE (saved_type);
error (_("Invalid anonymous type %s [in module %s], GCC PR debug/47510 bug?"),
name ? name : "<anonymous>",
{
char *type_name;
- type_name = type_name_no_tag (type);
+ type_name = TYPE_NAME (type);
if (type_name != NULL && strcmp (type_name, name) == 0)
return type;
}
if (currently_reading_symtab)
return make_qualified_type (type, instance_flags, NULL);
- name = type_name_no_tag (type);
+ name = TYPE_NAME (type);
/* FIXME: shouldn't we look in STRUCT_DOMAIN and/or
VAR_DOMAIN as appropriate? */
if (name == NULL)
&& opaque_type_resolution
&& !currently_reading_symtab)
{
- const char *name = type_name_no_tag (type);
+ const char *name = TYPE_NAME (type);
struct type *newtype;
if (name == NULL)
types. */
else if (TYPE_STUB (type) && !currently_reading_symtab)
{
- const char *name = type_name_no_tag (type);
+ const char *name = TYPE_NAME (type);
/* FIXME: shouldn't we look in STRUCT_DOMAIN and/or VAR_DOMAIN
as appropriate? */
struct symbol *sym;
extern struct type *allocate_stub_method (struct type *);
-extern const char *type_name_no_tag (const struct type *);
-
-extern const char *type_name_no_tag_or_error (struct type *type);
+extern const char *type_name_or_error (struct type *type);
extern struct type *lookup_struct_elt_type (struct type *, const char *, int);
std::vector<struct type *> *superclasses)
{
int ibase;
- const char *class_name = type_name_no_tag (t);
+ const char *class_name = TYPE_NAME (t);
/* Ignore this class if it doesn't have a name. This is ugly, but
unless we figure out how to get the physname without the name of
fprintf_filtered (stream, "%s%s ",
BASETYPE_VIA_PUBLIC (type, i) ? "public" : "private",
BASETYPE_VIA_VIRTUAL (type, i) ? " virtual" : "");
- name = type_name_no_tag (TYPE_BASECLASS (type, i));
+ name = TYPE_NAME (TYPE_BASECLASS (type, i));
fprintf_filtered (stream, "%s", name ? name : "(null)");
}
if (i > 0)
int
pascal_object_is_vtbl_ptr_type (struct type *type)
{
- const char *type_name = type_name_no_tag (type);
+ const char *type_name = TYPE_NAME (type);
return (type_name != NULL
&& strcmp (type_name, pascal_vtbl_ptr_name) == 0);
fprintf_filtered (stream, "\n");
print_spaces_filtered (2 + 2 * recurse, stream);
fputs_filtered ("members of ", stream);
- fputs_filtered (type_name_no_tag (type), stream);
+ fputs_filtered (TYPE_NAME (type), stream);
fputs_filtered (": ", stream);
}
}
{
LONGEST boffset = 0;
struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
- const char *basename = type_name_no_tag (baseclass);
+ const char *basename = TYPE_NAME (baseclass);
const gdb_byte *base_valaddr = NULL;
LONGEST thisoffset;
int skip = 0;
for (j = TYPE_N_BASECLASSES (SYMBOL_TYPE (sym)) - 1; j >= 0; j--)
if (TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) == 0)
TYPE_BASECLASS_NAME (SYMBOL_TYPE (sym), j) =
- type_name_no_tag (TYPE_BASECLASS (SYMBOL_TYPE (sym), j));
+ TYPE_NAME (TYPE_BASECLASS (SYMBOL_TYPE (sym), j));
}
if (TYPE_NAME (SYMBOL_TYPE (sym)) == NULL)
switch (cpp_abbrev)
{
case 'f': /* $vf -- a virtual function table pointer */
- name = type_name_no_tag (context);
+ name = TYPE_NAME (context);
if (name == NULL)
{
name = "";
break;
case 'b': /* $vb -- a virtual bsomethingorother */
- name = type_name_no_tag (context);
+ name = TYPE_NAME (context);
if (name == NULL)
{
complaint (_("C++ abbreviated type name "
field's name. */
newobj->field.type = read_type (pp, objfile);
- newobj->field.name = type_name_no_tag (newobj->field.type);
+ newobj->field.name = TYPE_NAME (newobj->field.type);
/* Skip trailing ';' and bump count of number of fields seen. */
if (**pp == ';')
struct fn_field *method = &f[signature_id];
const char *field_name = TYPE_FN_FIELDLIST_NAME (type, method_id);
const char *physname = TYPE_FN_FIELD_PHYSNAME (f, signature_id);
- const char *newname = type_name_no_tag (type);
+ const char *newname = TYPE_NAME (type);
/* Does the form of physname indicate that it is the full mangled name
of a constructor (not just the args)? */
offset the pointer rather than just change its type. */
if (TYPE_NAME (t1) != NULL)
{
- v = search_struct_field (type_name_no_tag (t1),
+ v = search_struct_field (TYPE_NAME (t1),
v2, t2, 1);
if (v)
return v;
&& !strcmp (TYPE_NAME (real_type), TYPE_NAME (t1)))
return v;
- v = search_struct_field (type_name_no_tag (t2), v, real_type, 1);
+ v = search_struct_field (TYPE_NAME (t2), v, real_type, 1);
if (v)
return v;
}
/* Try downcasting using information from the destination type
T2. This wouldn't work properly for classes with virtual
bases, but those were handled above. */
- v = search_struct_field (type_name_no_tag (t2),
+ v = search_struct_field (TYPE_NAME (t2),
value_zero (t1, not_lval), t1, 1);
if (v)
{
{
if (name[0] == '~')
{
- const char *dname = type_name_no_tag_or_error (type);
+ const char *dname = type_name_or_error (type);
const char *cp = strchr (dname, '<');
unsigned int len;