This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Use std::vector for symtab_fns
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 11 Oct 2017 14:05:27 +0100
- Subject: Re: [PATCH] Use std::vector for symtab_fns
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 39F96356F6
- References: <1507665661-14742-1-git-send-email-simon.marchi@ericsson.com>
On 10/10/2017 09:01 PM, Simon Marchi wrote:
> Simple replacement of VEC with std::vector.
>
> gdb/ChangeLog:
>
> * symfile.c (registered_sym_fns): Make struct, not typedef.
> (DEF_VEC_O (registered_sym_fns)): Remove.
> (symtab_fns): Change type to std::vector.
> (add_symtab_fns): Adjust.
> (find_sym_fns): Adjust.
OK.
> - for (i = 0; VEC_iterate (registered_sym_fns, symtab_fns, i, rsf); ++i)
> - if (our_flavour == rsf->sym_flavour)
> - return rsf->sym_fns;
> + for (registered_sym_fns &rsf : symtab_fns)
Small nit: could this be a const ref? I think it's a good
rule to prefer const over non-const references if we can.
> + if (our_flavour == rsf.sym_flavour)
> + return rsf.sym_fns;
>
> error (_("I'm sorry, Dave, I can't do that. Symbol format `%s' unknown."),
> bfd_get_target (abfd));
>
Thanks,
Pedro Alves