summaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-18 20:01:31 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2013-02-18 20:01:31 +0000
commit49e6b159a6b2225a0198f8e261c6b6f3772fba3f (patch)
tree7474601b4ae09317bf0a9ed2647974807abfc493 /libiberty
parent2fffb07a72d0755a559b08cfa30eb12d277daec1 (diff)
downloadgcc-49e6b159a6b2225a0198f8e261c6b6f3772fba3f.tar.gz
2013-02-18 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 196123 using svnmerge.py git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@196126 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/ChangeLog11
-rw-r--r--libiberty/cp-demangle.c21
-rw-r--r--libiberty/regex.c10
-rw-r--r--libiberty/testsuite/demangle-expected3
4 files changed, 40 insertions, 5 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index cbcd1e25948..7935ad69f44 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,14 @@
+2013-02-14 Jason Merrill <jason@redhat.com>
+
+ * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_DEFAULT_ARG.
+ (d_print_comp): Likewise.
+
+2013-02-09 Jakub Jelinek <jakub@redhat.com>
+
+ PR other/56245
+ * regex.c (PTR_INT_TYPE): Define.
+ (EXTEND_BUFFER): Change incr type from int to PTR_INT_TYPE.
+
2013-01-31 Kai Tietz <ktietz@redhat.com>
PR other/54620
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 913d4bf09d4..39be0314cea 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -707,6 +707,14 @@ d_dump (struct demangle_component *dc, int indent)
case DEMANGLE_COMPONENT_TLS_WRAPPER:
printf ("tls wrapper function\n");
break;
+ case DEMANGLE_COMPONENT_DEFAULT_ARG:
+ printf ("default argument %d\n", dc->u.s_unary_num.num);
+ d_dump (dc->u.s_unary_num.sub, indent+2);
+ return;
+ case DEMANGLE_COMPONENT_LAMBDA:
+ printf ("lambda %d\n", dc->u.s_unary_num.num);
+ d_dump (dc->u.s_unary_num.sub, indent+2);
+ return;
}
d_dump (d_left (dc), indent + 2);
@@ -3168,6 +3176,7 @@ d_expr_primary (struct d_info *di)
/* <local-name> ::= Z <(function) encoding> E <(entity) name> [<discriminator>]
::= Z <(function) encoding> E s [<discriminator>]
+ ::= Z <(function) encoding> E d [<parameter> number>] _ <entity name>
*/
static struct demangle_component *
@@ -3869,7 +3878,17 @@ d_print_comp (struct d_print_info *dpi, int options,
d_append_string (dpi, "::");
else
d_append_char (dpi, '.');
- d_print_comp (dpi, options, d_right (dc));
+ {
+ struct demangle_component *local_name = d_right (dc);
+ if (local_name->type == DEMANGLE_COMPONENT_DEFAULT_ARG)
+ {
+ d_append_string (dpi, "{default arg#");
+ d_append_num (dpi, local_name->u.s_unary_num.num + 1);
+ d_append_string (dpi, "}::");
+ local_name = local_name->u.s_unary_num.sub;
+ }
+ d_print_comp (dpi, options, local_name);
+ }
return;
case DEMANGLE_COMPONENT_TYPED_NAME:
diff --git a/libiberty/regex.c b/libiberty/regex.c
index d65eedb1670..17091ce9569 100644
--- a/libiberty/regex.c
+++ b/libiberty/regex.c
@@ -4,7 +4,7 @@
internationalization features.)
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2005, 2010 Free Software Foundation, Inc.
+ 2002, 2005, 2010, 2013 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -46,9 +46,11 @@
# if defined STDC_HEADERS && !defined emacs
# include <stddef.h>
+# define PTR_INT_TYPE ptrdiff_t
# else
/* We need this for `regex.h', and perhaps for the Emacs include files. */
# include <sys/types.h>
+# define PTR_INT_TYPE long
# endif
# define WIDE_CHAR_SUPPORT (HAVE_WCTYPE_H && HAVE_WCHAR_H && HAVE_BTOWC)
@@ -2045,7 +2047,7 @@ static reg_errcode_t byte_compile_range (unsigned int range_start,
/* How many characters the new buffer can have? */ \
wchar_count = bufp->allocated / sizeof(UCHAR_T); \
if (wchar_count == 0) wchar_count = 1; \
- /* Truncate the buffer to CHAR_T align. */ \
+ /* Truncate the buffer to CHAR_T align. */ \
bufp->allocated = wchar_count * sizeof(UCHAR_T); \
RETALLOC (COMPILED_BUFFER_VAR, wchar_count, UCHAR_T); \
bufp->buffer = (char*)COMPILED_BUFFER_VAR; \
@@ -2054,7 +2056,7 @@ static reg_errcode_t byte_compile_range (unsigned int range_start,
/* If the buffer moved, move all the pointers into it. */ \
if (old_buffer != COMPILED_BUFFER_VAR) \
{ \
- int incr = COMPILED_BUFFER_VAR - old_buffer; \
+ PTR_INT_TYPE incr = COMPILED_BUFFER_VAR - old_buffer; \
MOVE_BUFFER_POINTER (b); \
MOVE_BUFFER_POINTER (begalt); \
if (fixup_alt_jump) \
@@ -2082,7 +2084,7 @@ static reg_errcode_t byte_compile_range (unsigned int range_start,
/* If the buffer moved, move all the pointers into it. */ \
if (old_buffer != COMPILED_BUFFER_VAR) \
{ \
- int incr = COMPILED_BUFFER_VAR - old_buffer; \
+ PTR_INT_TYPE incr = COMPILED_BUFFER_VAR - old_buffer; \
MOVE_BUFFER_POINTER (b); \
MOVE_BUFFER_POINTER (begalt); \
if (fixup_alt_jump) \
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 5b41b03f9fa..17eacaaa8d0 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -3951,6 +3951,9 @@ S::f(int, int)::{default arg#2}::{lambda()#2}::operator()() const
_ZNK1SIiE1xMUlvE1_clEv
S<int>::x::{lambda()#3}::operator()() const
--format=gnu-v3
+_ZN8functionC1IZN1CIiE4testES_Ed_UliE_EET_
+function::function<C<int>::test(function)::{default arg#1}::{lambda(int)#1}>(C<int>::test(function)::{default arg#1}::{lambda(int)#1})
+--format=gnu-v3
_Z1fN1SUt_E
f(S::{unnamed type#1})
--format=gnu-v3