diff options
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -9256,6 +9256,42 @@ clean_symbol_name (char *p) *p = '_'; } +/* For anonymous aggregate types, we need some sort of name to + hold on to. In practice, this should not appear, but it should + not be harmful if it does. */ +bool +anon_aggrname_p(const_tree id_node) +{ +#ifndef NO_DOT_IN_LABEL + return (IDENTIFIER_POINTER (id_node)[0] == '.' + && IDENTIFIER_POINTER (id_node)[1] == '_'); +#else /* NO_DOT_IN_LABEL */ +#ifndef NO_DOLLAR_IN_LABEL + return (IDENTIFIER_POINTER (id_node)[0] == '$' \ + && IDENTIFIER_POINTER (id_node)[1] == '_'); +#else /* NO_DOLLAR_IN_LABEL */ +#define ANON_AGGRNAME_PREFIX "__anon_" + return (!strncmp (IDENTIFIER_POINTER (id_node), ANON_AGGRNAME_PREFIX, + sizeof (ANON_AGGRNAME_PREFIX) - 1)); +#endif /* NO_DOLLAR_IN_LABEL */ +#endif /* NO_DOT_IN_LABEL */ +} + +/* Return a format for an anonymous aggregate name. */ +const char * +anon_aggrname_format() +{ +#ifndef NO_DOT_IN_LABEL + return "._%d"; +#else /* NO_DOT_IN_LABEL */ +#ifndef NO_DOLLAR_IN_LABEL + return "$_%d"; +#else /* NO_DOLLAR_IN_LABEL */ + return "__anon_%d"; +#endif /* NO_DOLLAR_IN_LABEL */ +#endif /* NO_DOT_IN_LABEL */ +} + /* Generate a name for a special-purpose function. The generated name may need to be unique across the whole link. Changes to this function may also require corresponding changes to |