]> gcc.gnu.org Git - gcc.git/commitdiff
libiberty: Add support for `in' and `in ref' storage classes.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 4 Aug 2020 16:11:51 +0000 (18:11 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Wed, 26 Aug 2020 08:03:56 +0000 (10:03 +0200)
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.

libiberty/d-demangle.c
libiberty/testsuite/d-demangle-expected

index f2d6946ecad69947d237c064dc836e28cfe9a876..2e52eff76173be98cb039f5525f0f17591094be3 100644 (file)
@@ -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 */
index e3f32e31d7bd96d3e3ef2653c7b5960016831c27..ffb317f23d4cf1ee839742d2742ac55bba8b33ec 100644 (file)
@@ -274,14 +274,6 @@ _D8demangle4testFNhG4dZv
 demangle.test(__vector(double[4]))
 #
 --format=dlang
-_D8demangle4testFI5identZv
-demangle.test(ident)
-#
---format=dlang
-_D8demangle4testFI5ident4testZv
-demangle.test(ident.test)
-#
---format=dlang
 _D8demangle4testFC5classZv
 demangle.test(class)
 #
@@ -314,6 +306,14 @@ _D8demangle4testFT7typedef4testZv
 demangle.test(typedef.test)
 #
 --format=dlang
+_D8demangle4testFIaZv
+demangle.test(in char)
+#
+--format=dlang
+_D8demangle4testFIKaZv
+demangle.test(in ref char)
+#
+--format=dlang
 _D8demangle4testFJaZv
 demangle.test(out char)
 #
This page took 0.062101 seconds and 5 git commands to generate.