From 9b27f1138f0507b4af6d8067686305112eb0485d Mon Sep 17 00:00:00 2001 From: Artemiy Volkov Date: Wed, 18 May 2016 21:52:26 +0000 Subject: [PATCH] cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference constant. * cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference constant. (demangle_template_value_parm): Handle tk_rvalue_reference type kind. (do_type): Support 'O' type id (rvalue references). * testsuite/demangle-expected: Add tests. From-SVN: r236434 --- libiberty/ChangeLog | 10 +++ libiberty/cplus-dem.c | 13 ++- libiberty/testsuite/demangle-expected | 115 ++++++++++++++++++++++++++ 3 files changed, 136 insertions(+), 2 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 1407cd3ff98..25597967b2d 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,13 @@ +2016-05-18 Artemiy Volkov + + * cplus-dem.c (enum type_kind_t): Add tk_rvalue_reference + constant. + (demangle_template_value_parm): Handle tk_rvalue_reference + type kind. + (do_type): Support 'O' type id (rvalue references). + + * testsuite/demangle-expected: Add tests. + 2016-05-02 Marcel Böhme PR c++/70498 diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c index 7514e57913c..d04c32a904a 100644 --- a/libiberty/cplus-dem.c +++ b/libiberty/cplus-dem.c @@ -244,6 +244,7 @@ typedef enum type_kind_t tk_none, tk_pointer, tk_reference, + tk_rvalue_reference, tk_integral, tk_bool, tk_char, @@ -2042,7 +2043,8 @@ demangle_template_value_parm (struct work_stuff *work, const char **mangled, } else if (tk == tk_real) success = demangle_real_value (work, mangled, s); - else if (tk == tk_pointer || tk == tk_reference) + else if (tk == tk_pointer || tk == tk_reference + || tk == tk_rvalue_reference) { if (**mangled == 'Q') success = demangle_qualified (work, mangled, s, @@ -3588,6 +3590,14 @@ do_type (struct work_stuff *work, const char **mangled, string *result) tk = tk_reference; break; + /* An rvalue reference type */ + case 'O': + (*mangled)++; + string_prepend (&decl, "&&"); + if (tk == tk_none) + tk = tk_rvalue_reference; + break; + /* An array */ case 'A': { @@ -3645,7 +3655,6 @@ do_type (struct work_stuff *work, const char **mangled, string *result) break; case 'M': - case 'O': { type_quals = TYPE_UNQUALIFIED; diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index d124261121f..62ab18ca37d 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -31,6 +31,11 @@ ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &, Graphic *) ArrowLine::ArrowheadIntersects # --format=gnu --no-params +ArrowheadIntersects__9ArrowLineP9ArrowheadO6BoxObjP7Graphic +ArrowLine::ArrowheadIntersects(Arrowhead *, BoxObj &&, Graphic *) +ArrowLine::ArrowheadIntersects +# +--format=gnu --no-params AtEnd__13ivRubberGroup ivRubberGroup::AtEnd(void) ivRubberGroup::AtEnd @@ -51,6 +56,11 @@ TextCode::CoreConstDecls(ostream &) TextCode::CoreConstDecls # --format=gnu --no-params +CoreConstDecls__8TextCodeO7ostream +TextCode::CoreConstDecls(ostream &&) +TextCode::CoreConstDecls +# +--format=gnu --no-params Detach__8StateVarP12StateVarView StateVar::Detach(StateVarView *) StateVar::Detach @@ -66,21 +76,41 @@ RelateManip::Effect(ivEvent &) RelateManip::Effect # --format=gnu --no-params +Effect__11RelateManipO7ivEvent +RelateManip::Effect(ivEvent &&) +RelateManip::Effect +# +--format=gnu --no-params FindFixed__FRP4CNetP4CNet FindFixed(CNet *&, CNet *) FindFixed # --format=gnu --no-params +FindFixed__FOP4CNetP4CNet +FindFixed(CNet *&&, CNet *) +FindFixed +# +--format=gnu --no-params Fix48_abort__FR8twolongs Fix48_abort(twolongs &) Fix48_abort # --format=gnu --no-params +Fix48_abort__FO8twolongs +Fix48_abort(twolongs &&) +Fix48_abort +# +--format=gnu --no-params GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveRiT2 iv2_6_VScroller::GetBarInfo(ivPerspective *, int &, int &) iv2_6_VScroller::GetBarInfo # --format=gnu --no-params +GetBarInfo__15iv2_6_VScrollerP13ivPerspectiveOiT2 +iv2_6_VScroller::GetBarInfo(ivPerspective *, int &&, int &&) +iv2_6_VScroller::GetBarInfo +# +--format=gnu --no-params GetBgColor__C9ivPainter ivPainter::GetBgColor(void) const ivPainter::GetBgColor @@ -986,11 +1016,21 @@ List::Pix::Pix(List::Pix const &) List::Pix::Pix # --format=gnu --no-params +__Q2t4List1Z10VHDLEntity3PixOCQ2t4List1Z10VHDLEntity3Pix +List::Pix::Pix(List::Pix const &&) +List::Pix::Pix +# +--format=gnu --no-params __Q2t4List1Z10VHDLEntity7elementRC10VHDLEntityPT0 List::element::element(VHDLEntity const &, List::element *) List::element::element # --format=gnu --no-params +__Q2t4List1Z10VHDLEntity7elementOC10VHDLEntityPT0 +List::element::element(VHDLEntity const &&, List::element *) +List::element::element +# +--format=gnu --no-params __Q2t4List1Z10VHDLEntity7elementRCQ2t4List1Z10VHDLEntity7element List::element::element(List::element const &) List::element::element @@ -1036,6 +1076,11 @@ PixX >::PixX(PixX >::PixX # --format=gnu --no-params +__t4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntityOCt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity +PixX >::PixX(PixX > const &&) +PixX >::PixX +# +--format=gnu --no-params nextE__C11VHDLLibraryRt4PixX3Z11VHDLLibraryZ14VHDLLibraryRepZt4List1Z10VHDLEntity VHDLLibrary::nextE(PixX > &) const VHDLLibrary::nextE @@ -1261,6 +1306,11 @@ smanip_int::smanip_int(ios &(*)(ios &, int), int) smanip_int::smanip_int # --format=lucid --no-params +__ct__10smanip_intFPFO3iosi_O3iosi +smanip_int::smanip_int(ios &&(*)(ios &&, int), int) +smanip_int::smanip_int +# +--format=lucid --no-params __ct__11fstreambaseFi fstreambase::fstreambase(int) fstreambase::fstreambase @@ -1281,6 +1331,11 @@ smanip_long::smanip_long(ios &(*)(ios &, long), long) smanip_long::smanip_long # --format=lucid --no-params +__ct__11smanip_longFPFO3iosl_O3iosl +smanip_long::smanip_long(ios &&(*)(ios &&, long), long) +smanip_long::smanip_long +# +--format=lucid --no-params __ct__11stdiostreamFP4FILE stdiostream::stdiostream(FILE *) stdiostream::stdiostream @@ -1321,6 +1376,11 @@ foo::foo(foo &) foo::foo # --format=lucid --no-params +__ct__3fooFO3foo +foo::foo(foo &&) +foo::foo +# +--format=lucid --no-params __ct__3fooFi foo::foo(int) foo::foo @@ -1336,6 +1396,11 @@ foo::foo(int, foo &, int, foo &, int, foo &) foo::foo # --format=lucid --no-params +__ct__3fooFiO3fooT1T2T1T2 +foo::foo(int, foo &&, int, foo &&, int, foo &&) +foo::foo +# +--format=lucid --no-params __ct__3iosFP9streambuf ios::ios(streambuf *) ios::ios @@ -1811,6 +1876,11 @@ foo(int, foo &, int, foo &, int, foo &) foo # --format=lucid --no-params +foo__FiO3fooT1T2T1T2 +foo(int, foo &&, int, foo &&, int, foo &&) +foo +# +--format=lucid --no-params foo___3barFl bar::foo_(long) bar::foo_ @@ -2561,6 +2631,11 @@ DListNode::DListNode(RLabel &, DListNode *, DListNode::DListNode # --format=arm --no-params +__ct__25DListNode__pt__9_O6RLabelFO6RLabelP25DListNode__pt__9_O6RLabelT2 +DListNode::DListNode(RLabel &&, DListNode *, DListNode *) +DListNode::DListNode +# +--format=arm --no-params bar__3fooFiT16FooBar foo::bar(int, int, FooBar) foo::bar @@ -2991,6 +3066,11 @@ DListNode::DListNode(RLabel &, DListNode *, DListNode::DListNode # --format=hp --no-params +__ct__9DListNodeXTO6RLabel__FO6RLabelP9DListNodeXTO6RLabel_T2 +DListNode::DListNode(RLabel &&, DListNode *, DListNode *) +DListNode::DListNode +# +--format=hp --no-params elem__6vectorXTiUP34__Fi vector::elem(int) vector::elem @@ -3021,16 +3101,31 @@ vector::elem(int) vector::elem # --format=hp --no-params +elem__6vectorXTiSN67UP4000TOs__Fi +vector::elem(int) +vector::elem +# +--format=hp --no-params elem__6vectorXTiSN67TRdTFPv_i__Fi vector::elem(int) vector::elem # --format=hp --no-params +elem__6vectorXTiSN67TOdTFPv_i__Fi +vector::elem(int) +vector::elem +# +--format=hp --no-params X__6vectorXTiSN67TdTPvUP5TRs vector::X vector::X # --format=hp --no-params +X__6vectorXTiSN67TdTPvUP5TOs +vector::X +vector::X +# +--format=hp --no-params elem__6vectorXTiA3foo__Fi vector::elem(int) vector::elem @@ -3071,6 +3166,11 @@ Spec::spec(int *) Spec::spec # --format=hp --no-params +spec__17Spec<#1,#1.&&,#1>XTiTOiTi_FPi +Spec::spec(int *) +Spec::spec +# +--format=hp --no-params add__XTc_FcT1 add(char, char) add @@ -3101,6 +3201,11 @@ C call(Test &) C call # --format=gnu --no-params +call__H1Z4Test_OX01_t1C2ZX01PMX01FPX01i_vQ2X016output +C call(Test &&) +C call +# +--format=gnu --no-params fn__FPQ21n1cPMQ21n1cFPQ21n1c_i fn(n::c *, int (n::c::*)(n::c *)) fn @@ -3126,6 +3231,11 @@ int foo > >(TA >) int foo > > # --format=gnu --no-params +foo__H1Zt2TA2ZOCiZt2NA1Ui9_X01_i +int foo > >(TA >) +int foo > > +# +--format=gnu --no-params foo__H1Zt2TA2ZcZt2NA1Ui20_X01_i int foo > >(TA >) int foo > > @@ -3402,6 +3512,11 @@ int* const volatile restrict _far _Z3fooILi2EEvRAplT_Li1E_i void foo<2>(int (&) [(2)+(1)]) foo<2> +# +--format=gnu-v3 --no-params +_Z3fooILi2EEvOAplT_Li1E_i +void foo<2>(int (&&) [(2)+(1)]) +foo<2> # --format=gnu-v3 --no-params _Z1fM1AKFvvE -- 2.30.2