diff options
Diffstat (limited to 'gcc/d')
-rw-r--r-- | gcc/d/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/d/types.cc | 9 |
2 files changed, 7 insertions, 7 deletions
diff --git a/gcc/d/ChangeLog b/gcc/d/ChangeLog index b6ac2f8..800dcb0 100644 --- a/gcc/d/ChangeLog +++ b/gcc/d/ChangeLog @@ -1,3 +1,8 @@ +2019-05-24 Nathan Sidwell <nathan@acm.org> + + * types.cc (fixup_anonymous_offset): Use IDENTIFIER_ANON_P. + (layout_aggregate_members): Use make_anon_name. + 2019-05-16 Martin Sebor <msebor@redhat.com> * d-builtins.cc (d_init_builtins): Quote keywords, operators, diff --git a/gcc/d/types.cc b/gcc/d/types.cc index cdbfbb7..8f0aa37 100644 --- a/gcc/d/types.cc +++ b/gcc/d/types.cc @@ -239,7 +239,7 @@ fixup_anonymous_offset (tree fields, tree offset) /* Traverse all nested anonymous aggregates to update their offset. Set the anonymous decl offset to its first member. */ tree ftype = TREE_TYPE (fields); - if (TYPE_NAME (ftype) && anon_aggrname_p (TYPE_IDENTIFIER (ftype))) + if (TYPE_NAME (ftype) && IDENTIFIER_ANON_P (TYPE_IDENTIFIER (ftype))) { tree vfields = TYPE_FIELDS (ftype); fixup_anonymous_offset (vfields, offset); @@ -324,12 +324,7 @@ layout_aggregate_members (Dsymbols *members, tree context, bool inherited_p) AnonDeclaration *ad = sym->isAnonDeclaration (); if (ad != NULL) { - /* Use a counter to create anonymous type names. */ - static int anon_cnt = 0; - char buf[32]; - sprintf (buf, anon_aggrname_format (), anon_cnt++); - - tree ident = get_identifier (buf); + tree ident = make_anon_name (); tree type = make_node (ad->isunion ? UNION_TYPE : RECORD_TYPE); ANON_AGGR_TYPE_P (type) = 1; d_keep (type); |