diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-08-04 18:11:51 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2020-08-26 10:03:56 +0200 |
commit | 387d0773f39a56b2a831a2b7e7ed189d6ffc2f36 (patch) | |
tree | 76be22c67db978cec95182958ee7bbbb67841a54 /libiberty/d-demangle.c | |
parent | f0a0a84cd9a75052114066a15beebeee8c2cf8ab (diff) | |
download | gcc-387d0773f39a56b2a831a2b7e7ed189d6ffc2f36.tar.gz |
libiberty: Add support for `in' and `in ref' storage classes.
The storage class `in' is now a first-class citizen with its own mangle
symbol, of which also permits `in ref'. Previously, `in' was an alias
to `const [scope]', which is a type constructor.
The mangle symbol repurposed for this is `I', which was originally used
by identifier types. However, while TypeIdentifier is part of the
grammar, it must be resolved to some other entity during the semantic
passes, and so shouldn't appear anywhere in the mangled name.
Old tests that are now no longer valid have been removed.
libiberty/ChangeLog:
* d-demangle.c (dlang_function_args): Handle 'in' and 'in ref'
parameter storage classes.
(dlang_type): Remove identifier type.
* testsuite/d-demangle-expected: Update tests.
Diffstat (limited to 'libiberty/d-demangle.c')
-rw-r--r-- | libiberty/d-demangle.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index f2d6946ecad..2e52eff7617 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -699,6 +699,15 @@ dlang_function_args (string *decl, const char *mangled, struct dlang_info *info) switch (*mangled) { + case 'I': /* in(T) */ + mangled++; + string_append (decl, "in "); + if (*mangled == 'K') /* in ref(T) */ + { + mangled++; + string_append (decl, "ref "); + } + break; case 'J': /* out(T) */ mangled++; string_append (decl, "out "); @@ -826,7 +835,6 @@ dlang_type (string *decl, const char *mangled, struct dlang_info *info) mangled = dlang_function_type (decl, mangled, info); string_append (decl, "function"); return mangled; - case 'I': /* ident T */ case 'C': /* class T */ case 'S': /* struct T */ case 'E': /* enum T */ |