OSDN Git Service

2007-08-31 Douglas Gregor <doug.gregor@gmail.com>
authordgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Aug 2007 19:15:26 +0000 (19:15 +0000)
committerdgregor <dgregor@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 31 Aug 2007 19:15:26 +0000 (19:15 +0000)
* mangle.c (write_type): Change mangling of rvalue reference from
`RR' to `O'.

2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>

* demangle.h (enum demangle_component_type): Add
DEMANGLE_COMPONENT_RVALUE_REFERENCE.

2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>

* cp-demangle.c (d_dump): Handle
DEMANGLE_COMPONENT_RVALUE_REFERENCE.
(d_make_comp): Ditto.
(cplus_demangle_type): Ditto.
(d_print_comp): Ditto.
(d_print_mod): Ditto.
(d_print_function_type): Ditto.

2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>

* testsuite/abi/demangle/cxx0x/rref.cc: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127999 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/mangle.c
include/ChangeLog
include/demangle.h
libiberty/ChangeLog
libiberty/cp-demangle.c
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/abi/demangle/cxx0x/rref.cc [new file with mode: 0644]

index 76dddf5..cc5e063 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * mangle.c (write_type): Change mangling of rvalue reference from
+       `RR' to `O'. 
+
 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
 
        * decl.c (duplicate_decls): Remove duplicated line.
 2007-08-31  Jakub Jelinek  <jakub@redhat.com>
 
        * decl.c (duplicate_decls): Remove duplicated line.
@@ -33,6 +38,7 @@
        (get_delta_difference_1): New function.
        (get_delta_difference): Refactor to call get_delta_difference_1.
 
        (get_delta_difference_1): New function.
        (get_delta_difference): Refactor to call get_delta_difference_1.
 
+>>>>>>> .r127998
 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/33209
 2007-08-28  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/33209
index 1759476..cad76e3 100644 (file)
@@ -1646,8 +1646,9 @@ write_type (tree type)
 
            case REFERENCE_TYPE:
              if (TYPE_REF_IS_RVALUE (type))
 
            case REFERENCE_TYPE:
              if (TYPE_REF_IS_RVALUE (type))
-               write_char('R');
-             write_char ('R');
+               write_char('O');
+              else
+                write_char ('R');
              write_type (TREE_TYPE (type));
              break;
 
              write_type (TREE_TYPE (type));
              break;
 
index cf9421e..b29d428 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
+       
+       * demangle.h (enum demangle_component_type): Add
+       DEMANGLE_COMPONENT_RVALUE_REFERENCE. 
+
 2007-07-25  Ben Elliston  <bje@au.ibm.com>
 
        * ternary.h: Remove.
 2007-07-25  Ben Elliston  <bje@au.ibm.com>
 
        * ternary.h: Remove.
index 49f23e5..b55226d 100644 (file)
@@ -296,6 +296,9 @@ enum demangle_component_type
   /* A reference.  The one subtree is the type which is being
      referenced.  */
   DEMANGLE_COMPONENT_REFERENCE,
   /* A reference.  The one subtree is the type which is being
      referenced.  */
   DEMANGLE_COMPONENT_REFERENCE,
+  /* C++0x: An rvalue reference.  The one subtree is the type which is
+     being referenced.  */
+  DEMANGLE_COMPONENT_RVALUE_REFERENCE,
   /* A complex type.  The one subtree is the base type.  */
   DEMANGLE_COMPONENT_COMPLEX,
   /* An imaginary type.  The one subtree is the base type.  */
   /* A complex type.  The one subtree is the base type.  */
   DEMANGLE_COMPONENT_COMPLEX,
   /* An imaginary type.  The one subtree is the base type.  */
index 8e34448..2e43390 100644 (file)
@@ -1,3 +1,13 @@
+2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
+       
+       * cp-demangle.c (d_dump): Handle
+       DEMANGLE_COMPONENT_RVALUE_REFERENCE. 
+       (d_make_comp): Ditto.
+       (cplus_demangle_type): Ditto.
+       (d_print_comp): Ditto.
+       (d_print_mod): Ditto.
+       (d_print_function_type): Ditto.
+
 2007-08-24  Kai Tietz  <kai.tietz@onevision.com>
 
        * pex-common.h: (pex_funcs): Retyped wait and exec_child to pid_t.
 2007-08-24  Kai Tietz  <kai.tietz@onevision.com>
 
        * pex-common.h: (pex_funcs): Retyped wait and exec_child to pid_t.
index e4869f0..3fc6a21 100644 (file)
@@ -596,6 +596,9 @@ d_dump (struct demangle_component *dc, int indent)
     case DEMANGLE_COMPONENT_REFERENCE:
       printf ("reference\n");
       break;
     case DEMANGLE_COMPONENT_REFERENCE:
       printf ("reference\n");
       break;
+    case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
+      printf ("rvalue reference\n");
+      break;
     case DEMANGLE_COMPONENT_COMPLEX:
       printf ("complex\n");
       break;
     case DEMANGLE_COMPONENT_COMPLEX:
       printf ("complex\n");
       break;
@@ -785,6 +788,7 @@ d_make_comp (struct d_info *di, enum demangle_component_type type,
     case DEMANGLE_COMPONENT_HIDDEN_ALIAS:
     case DEMANGLE_COMPONENT_POINTER:
     case DEMANGLE_COMPONENT_REFERENCE:
     case DEMANGLE_COMPONENT_HIDDEN_ALIAS:
     case DEMANGLE_COMPONENT_POINTER:
     case DEMANGLE_COMPONENT_REFERENCE:
+    case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
     case DEMANGLE_COMPONENT_COMPLEX:
     case DEMANGLE_COMPONENT_IMAGINARY:
     case DEMANGLE_COMPONENT_VENDOR_TYPE:
     case DEMANGLE_COMPONENT_COMPLEX:
     case DEMANGLE_COMPONENT_IMAGINARY:
     case DEMANGLE_COMPONENT_VENDOR_TYPE:
@@ -1726,6 +1730,7 @@ d_ctor_dtor_name (struct d_info *di)
           ::= <CV-qualifiers> <type>
           ::= P <type>
           ::= R <type>
           ::= <CV-qualifiers> <type>
           ::= P <type>
           ::= R <type>
+          ::= O <type> (C++0x)
           ::= C <type>
           ::= G <type>
           ::= U <source-name> <type>
           ::= C <type>
           ::= G <type>
           ::= U <source-name> <type>
@@ -1892,6 +1897,12 @@ cplus_demangle_type (struct d_info *di)
       }
       break;
 
       }
       break;
 
+    case 'O':
+      d_advance (di, 1);
+      ret = d_make_comp (di, DEMANGLE_COMPONENT_RVALUE_REFERENCE,
+                         cplus_demangle_type (di), NULL);
+      break;
+
     case 'P':
       d_advance (di, 1);
       ret = d_make_comp (di, DEMANGLE_COMPONENT_POINTER,
     case 'P':
       d_advance (di, 1);
       ret = d_make_comp (di, DEMANGLE_COMPONENT_POINTER,
@@ -1901,7 +1912,7 @@ cplus_demangle_type (struct d_info *di)
     case 'R':
       d_advance (di, 1);
       ret = d_make_comp (di, DEMANGLE_COMPONENT_REFERENCE,
     case 'R':
       d_advance (di, 1);
       ret = d_make_comp (di, DEMANGLE_COMPONENT_REFERENCE,
-                        cplus_demangle_type (di), NULL);
+                         cplus_demangle_type (di), NULL);
       break;
 
     case 'C':
       break;
 
     case 'C':
@@ -3184,6 +3195,7 @@ d_print_comp (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
     case DEMANGLE_COMPONENT_POINTER:
     case DEMANGLE_COMPONENT_REFERENCE:
     case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL:
     case DEMANGLE_COMPONENT_POINTER:
     case DEMANGLE_COMPONENT_REFERENCE:
+    case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
     case DEMANGLE_COMPONENT_COMPLEX:
     case DEMANGLE_COMPONENT_IMAGINARY:
       {
     case DEMANGLE_COMPONENT_COMPLEX:
     case DEMANGLE_COMPONENT_IMAGINARY:
       {
@@ -3708,6 +3720,9 @@ d_print_mod (struct d_print_info *dpi,
     case DEMANGLE_COMPONENT_REFERENCE:
       d_append_char (dpi, '&');
       return;
     case DEMANGLE_COMPONENT_REFERENCE:
       d_append_char (dpi, '&');
       return;
+    case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
+      d_append_string (dpi, "&&");
+      return;
     case DEMANGLE_COMPONENT_COMPLEX:
       d_append_string (dpi, "complex ");
       return;
     case DEMANGLE_COMPONENT_COMPLEX:
       d_append_string (dpi, "complex ");
       return;
@@ -3757,6 +3772,7 @@ d_print_function_type (struct d_print_info *dpi,
        {
        case DEMANGLE_COMPONENT_POINTER:
        case DEMANGLE_COMPONENT_REFERENCE:
        {
        case DEMANGLE_COMPONENT_POINTER:
        case DEMANGLE_COMPONENT_REFERENCE:
+       case DEMANGLE_COMPONENT_RVALUE_REFERENCE:
          need_paren = 1;
          break;
        case DEMANGLE_COMPONENT_RESTRICT:
          need_paren = 1;
          break;
        case DEMANGLE_COMPONENT_RESTRICT:
index 99048bb..55f64a7 100644 (file)
@@ -1,3 +1,7 @@
+2007-08-31  Douglas Gregor  <doug.gregor@gmail.com>
+
+       * testsuite/abi/demangle/cxx0x/rref.cc: New.
+
 2007-08-29  Benjamin Kosnik  <bkoz@redhat.com>
 
        * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ENODATA, ENOSR,
 2007-08-29  Benjamin Kosnik  <bkoz@redhat.com>
 
        * acinclude.m4 (GLIBCXX_CHECK_SYSTEM_ERROR): Add ENODATA, ENOSR,
diff --git a/libstdc++-v3/testsuite/abi/demangle/cxx0x/rref.cc b/libstdc++-v3/testsuite/abi/demangle/cxx0x/rref.cc
new file mode 100644 (file)
index 0000000..cb085b4
--- /dev/null
@@ -0,0 +1,32 @@
+// 2007-06-28 Douglas Gregor  <doug.gregor@gmail.com>
+
+// Copyright (C) 2007 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+int main()
+{
+  using namespace __gnu_test;
+
+  verify_demangle("_Z1fOi", "f(int&&)");
+
+  return 0;
+}