diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-04 21:44:11 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-07-04 21:44:11 +0000 |
commit | f220ea72a244b39883ea12ad2645466b0ebf3afd (patch) | |
tree | b8011ca57a5b16674319b5adca9ce5952b474a78 /libiberty/cp-demangle.c | |
parent | 56f83c408b691c00bcc9c3af94ad8cdaa4dfea9b (diff) | |
download | gcc-f220ea72a244b39883ea12ad2645466b0ebf3afd.tar.gz |
* cp-demangle.c (d_expression): Handle 'this'.
(d_print_comp) [DEMANGLE_COMPONENT_FUNCTION_PARAM]: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@175836 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r-- | libiberty/cp-demangle.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index f1363226c56..29badbba187 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -2738,10 +2738,18 @@ d_expression (struct d_info *di) /* Function parameter used in a late-specified return type. */ int index; d_advance (di, 2); - index = d_compact_number (di); - if (index < 0) - return NULL; - + if (d_peek_char (di) == 'T') + { + /* 'this' parameter. */ + d_advance (di, 1); + index = 0; + } + else + { + index = d_compact_number (di) + 1; + if (index == 0) + return NULL; + } return d_make_function_param (di, index); } else if (IS_DIGIT (peek) @@ -4400,9 +4408,17 @@ d_print_comp (struct d_print_info *dpi, int options, return; case DEMANGLE_COMPONENT_FUNCTION_PARAM: - d_append_string (dpi, "{parm#"); - d_append_num (dpi, dc->u.s_number.number + 1); - d_append_char (dpi, '}'); + { + long num = dc->u.s_number.number; + if (num == 0) + d_append_string (dpi, "this"); + else + { + d_append_string (dpi, "{parm#"); + d_append_num (dpi, num); + d_append_char (dpi, '}'); + } + } return; case DEMANGLE_COMPONENT_GLOBAL_CONSTRUCTORS: |