OSDN Git Service

* cp-demangle.c (cplus_demangle_type): decltype, pack expansion
[pf3gnuchains/gcc-fork.git] / libiberty / cp-demangle.c
index d0f57b7..0ed8397 100644 (file)
@@ -585,6 +585,12 @@ d_dump (struct demangle_component *dc, int indent)
     case DEMANGLE_COMPONENT_HIDDEN_ALIAS:
       printf ("hidden alias\n");
       break;
+    case DEMANGLE_COMPONENT_TRANSACTION_CLONE:
+      printf ("transaction clone\n");
+      break;
+    case DEMANGLE_COMPONENT_NONTRANSACTION_CLONE:
+      printf ("non-transaction clone\n");
+      break;
     case DEMANGLE_COMPONENT_RESTRICT:
       printf ("restrict\n");
       break;
@@ -732,7 +738,7 @@ cplus_demangle_fill_ctor (struct demangle_component *p,
   if (p == NULL
       || name == NULL
       || (int) kind < gnu_v3_complete_object_ctor
-      || (int) kind > gnu_v3_complete_object_allocating_ctor)
+      || (int) kind > gnu_v3_object_ctor_group)
     return 0;
   p->type = DEMANGLE_COMPONENT_CTOR;
   p->u.s_ctor.kind = kind;
@@ -751,7 +757,7 @@ cplus_demangle_fill_dtor (struct demangle_component *p,
   if (p == NULL
       || name == NULL
       || (int) kind < gnu_v3_deleting_dtor
-      || (int) kind > gnu_v3_base_object_dtor)
+      || (int) kind > gnu_v3_object_dtor_group)
     return 0;
   p->type = DEMANGLE_COMPONENT_DTOR;
   p->u.s_dtor.kind = kind;
@@ -823,6 +829,8 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
     case DEMANGLE_COMPONENT_GUARD:
     case DEMANGLE_COMPONENT_REFTEMP:
     case DEMANGLE_COMPONENT_HIDDEN_ALIAS:
+    case DEMANGLE_COMPONENT_TRANSACTION_CLONE:
+    case DEMANGLE_COMPONENT_NONTRANSACTION_CLONE:
     case DEMANGLE_COMPONENT_POINTER:
     case DEMANGLE_COMPONENT_REFERENCE:
     case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
@@ -1546,7 +1554,8 @@ d_identifier (struct d_info *di, int len)
 /* operator_name ::= many different two character encodings.
                  ::= cv <type>
                  ::= v <digit> <source-name>
-*/
+
+   This list is sorted for binary search.  */
 
 #define NL(s) s, (sizeof s) - 1
 
@@ -1558,6 +1567,8 @@ const struct demangle_operator_info cplus_demangle_operators[] =
   { "aa", NL ("&&"),        2 },
   { "ad", NL ("&"),         1 },
   { "an", NL ("&"),         2 },
+  { "at", NL ("alignof "),   1 },
+  { "az", NL ("alignof "),   1 },
   { "cl", NL ("()"),        2 },
   { "cm", NL (","),         2 },
   { "co", NL ("~"),         1 },
@@ -1603,8 +1614,6 @@ const struct demangle_operator_info cplus_demangle_operators[] =
   { "rs", NL (">>"),        2 },
   { "st", NL ("sizeof "),   1 },
   { "sz", NL ("sizeof "),   1 },
-  { "at", NL ("alignof "),   1 },
-  { "az", NL ("alignof "),   1 },
   { NULL, NULL, 0,          0 }
 };
 
@@ -1762,6 +1771,8 @@ d_java_resource (struct d_info *di)
                   ::= GR <name>
                  ::= GA <encoding>
                  ::= Gr <resource name>
+                 ::= GTt <encoding>
+                 ::= GTn <encoding>
 */
 
 static struct demangle_component *
@@ -1856,6 +1867,23 @@ d_special_name (struct d_info *di)
          return d_make_comp (di, DEMANGLE_COMPONENT_HIDDEN_ALIAS,
                              d_encoding (di, 0), NULL);
 
+       case 'T':
+         switch (d_next_char (di))
+           {
+           case 'n':
+             return d_make_comp (di, DEMANGLE_COMPONENT_NONTRANSACTION_CLONE,
+                                 d_encoding (di, 0), NULL);
+           default:
+             /* ??? The proposal is that other letters (such as 'h') stand
+                for different variants of transaction cloning, such as
+                compiling directly for hardware transaction support.  But
+                they still should all be transactional clones of some sort
+                so go ahead and call them that.  */
+           case 't':
+             return d_make_comp (di, DEMANGLE_COMPONENT_TRANSACTION_CLONE,
+                                 d_encoding (di, 0), NULL);
+           }
+
        case 'r':
          return d_java_resource (di);
 
@@ -1939,6 +1967,9 @@ d_ctor_dtor_name (struct d_info *di)
          case '3':
            kind = gnu_v3_complete_object_allocating_ctor;
            break;
+         case '5':
+           kind = gnu_v3_object_ctor_group;
+           break;
          default:
            return NULL;
          }
@@ -1961,6 +1992,9 @@ d_ctor_dtor_name (struct d_info *di)
          case '2':
            kind = gnu_v3_base_object_dtor;
            break;
+         case '5':
+           kind = gnu_v3_object_dtor_group;
+           break;
          default:
            return NULL;
          }
@@ -2209,12 +2243,14 @@ cplus_demangle_type (struct d_info *di)
                             d_expression (di), NULL);
          if (ret && d_next_char (di) != 'E')
            ret = NULL;
+         can_subst = 1;
          break;
          
        case 'p':
          /* Pack expansion.  */
          ret = d_make_comp (di, DEMANGLE_COMPONENT_PACK_EXPANSION,
                             cplus_demangle_type (di), NULL);
+         can_subst = 1;
          break;
          
        case 'f':
@@ -2265,6 +2301,7 @@ cplus_demangle_type (struct d_info *di)
 
        case 'v':
          ret = d_vector_type (di);
+         can_subst = 1;
          break;
 
         case 'n':
@@ -3935,6 +3972,16 @@ d_print_comp (struct d_print_info *dpi, int options,
       d_print_comp (dpi, options, d_left (dc));
       return;
 
+    case DEMANGLE_COMPONENT_TRANSACTION_CLONE:
+      d_append_string (dpi, "transaction clone for ");
+      d_print_comp (dpi, options, d_left (dc));
+      return;
+
+    case DEMANGLE_COMPONENT_NONTRANSACTION_CLONE:
+      d_append_string (dpi, "non-transaction clone for ");
+      d_print_comp (dpi, options, d_left (dc));
+      return;
+
     case DEMANGLE_COMPONENT_SUB_STD:
       d_append_buffer (dpi, dc->u.s_string.string, dc->u.s_string.len);
       return;