Merge libiberty from gcc

This commit is contained in:
Alan Modra 2019-04-07 20:41:49 +09:30
parent 5f60cccf9d
commit 07ffcfecac
10 changed files with 97 additions and 42 deletions

View file

@ -2364,9 +2364,10 @@ cplus_demangle_builtin_types[D_BUILTIN_TYPE_COUNT] =
/* 27 */ { NL ("decimal64"), NL ("decimal64"), D_PRINT_DEFAULT },
/* 28 */ { NL ("decimal128"), NL ("decimal128"), D_PRINT_DEFAULT },
/* 29 */ { NL ("half"), NL ("half"), D_PRINT_FLOAT },
/* 30 */ { NL ("char16_t"), NL ("char16_t"), D_PRINT_DEFAULT },
/* 31 */ { NL ("char32_t"), NL ("char32_t"), D_PRINT_DEFAULT },
/* 32 */ { NL ("decltype(nullptr)"), NL ("decltype(nullptr)"),
/* 30 */ { NL ("char8_t"), NL ("char8_t"), D_PRINT_DEFAULT },
/* 31 */ { NL ("char16_t"), NL ("char16_t"), D_PRINT_DEFAULT },
/* 32 */ { NL ("char32_t"), NL ("char32_t"), D_PRINT_DEFAULT },
/* 33 */ { NL ("decltype(nullptr)"), NL ("decltype(nullptr)"),
D_PRINT_DEFAULT },
};
@ -2654,14 +2655,19 @@ cplus_demangle_type (struct d_info *di)
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[29]);
di->expansion += ret->u.s_builtin.type->len;
break;
case 'u':
/* char8_t */
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[30]);
di->expansion += ret->u.s_builtin.type->len;
break;
case 's':
/* char16_t */
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[30]);
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[31]);
di->expansion += ret->u.s_builtin.type->len;
break;
case 'i':
/* char32_t */
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[31]);
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[32]);
di->expansion += ret->u.s_builtin.type->len;
break;
@ -2687,7 +2693,7 @@ cplus_demangle_type (struct d_info *di)
case 'n':
/* decltype(nullptr) */
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[32]);
ret = d_make_builtin_type (di, &cplus_demangle_builtin_types[33]);
di->expansion += ret->u.s_builtin.type->len;
break;
@ -6201,13 +6207,13 @@ cplus_demangle_init_info (const char *mangled, int options, size_t len,
di->n = mangled;
/* We can not need more components than twice the number of chars in
/* We cannot need more components than twice the number of chars in
the mangled string. Most components correspond directly to
chars, but the ARGLIST types are exceptions. */
di->num_comps = 2 * len;
di->next_comp = 0;
/* Similarly, we can not need more substitutions than there are
/* Similarly, we cannot need more substitutions than there are
chars in the mangled string. */
di->num_subs = len;
di->next_sub = 0;