This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type
- From: Keith Seitz <keiths at redhat dot com>
- To: Artemiy Volkov <artemiyv at acm dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 19 Feb 2016 10:53:36 -0800
- Subject: Re: [PATCH v2 04/11] [PR gdb/14441] gdb: parse: support rvalue reference type
- Authentication-results: sourceware.org; auth=none
- References: <1450661481-31178-1-git-send-email-artemiyv at acm dot org> <1453229609-20159-1-git-send-email-artemiyv at acm dot org> <1453229609-20159-5-git-send-email-artemiyv at acm dot org>
Another patch of nothing but coding standard "nits."
On 01/19/2016 10:53 AM, Artemiy Volkov wrote:
> 2016-01-19 Artemiy Volkov <artemiyv@acm.org>
>
> * gdb/c-exp.y: Handle the '&&' token in the typename.
> * gdb/parse.c (insert_type): Change assert statement.
> (follow_types): Handle rvalue reference types.
> * gdb/parser-defs.h (enum type_pieces): Add tp_rvalue_reference
> constant.
Nit: That last one should be
* parser-defs.h (enum type_pieces) <tp_rvalue_reference>: New constant.
> diff --git a/gdb/parse.c b/gdb/parse.c
> index 06f7bcd..75627c5 100644
> --- a/gdb/parse.c
> +++ b/gdb/parse.c
> @@ -1695,21 +1695,26 @@ follow_types (struct type *follow_type)
> make_addr_space = 0;
> break;
> case tp_reference:
> - follow_type = lookup_lvalue_reference_type (follow_type);
> - if (make_const)
> - follow_type = make_cv_type (make_const,
> - TYPE_VOLATILE (follow_type),
> - follow_type, 0);
> - if (make_volatile)
> - follow_type = make_cv_type (TYPE_CONST (follow_type),
> - make_volatile,
> - follow_type, 0);
> - if (make_addr_space)
> - follow_type = make_type_with_address_space (follow_type,
> - make_addr_space);
> + follow_type = lookup_lvalue_reference_type (follow_type);
> + goto process_reference;
> + case tp_rvalue_reference:
> + follow_type = lookup_rvalue_reference_type (follow_type);
> + process_reference:
> + if (make_const)
> + follow_type = make_cv_type (make_const,
> + TYPE_VOLATILE (follow_type),
> + follow_type, 0);
> + if (make_volatile)
> + follow_type = make_cv_type (TYPE_CONST (follow_type),
> + make_volatile,
> + follow_type, 0);
> + if (make_addr_space)
> + follow_type = make_type_with_address_space (follow_type,
> + make_addr_space);
> make_const = make_volatile = 0;
> make_addr_space = 0;
> break;
> +
Just a comment -- nothing for you to do. This process_reference:
really is about dealing with qualifiers, and I see that this is
cut-n-pasted into several different cases. Yuck.
> case tp_array:
> array_size = pop_type_int ();
> /* FIXME-type-allocation: need a way to free this type when we are
Keith