Re: [PATCH 5/7] jit: make gdb_object::symtabs a vector of unique_ptr

Pedro Alves
2019-12-13T17:54:44Z

On 12/13/19 6:03 AM, Simon Marchi wrote:
> struct gdb_object
> {
> - std::vector<gdb_symtab *> symtabs;
> + std::vector<std::unique_ptr<gdb_symtab>> symtabs;
> };

Could this be a vector or objects instead of a vector or pointers?

Like:

std::vector<gdb_symtab> symtabs;

> + object->symtabs.emplace_back (new gdb_symtab (file_name));
> + return object->symtabs.back ().get ();
> }

and:

object->symtabs.emplace_back (file_name);
return &object->symtabs.back ();

Thanks,
Pedro Alves