Now that compunit_symtab can have a destructor, it can use
std::unique_ptr rather than an explicit 'delete'.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
compunit_symtab::set_call_site_htab (call_site_htab_t &&call_site_htab)
{
gdb_assert (m_call_site_htab == nullptr);
- m_call_site_htab = new call_site_htab_t (std::move (call_site_htab));
+ m_call_site_htab
+ = std::make_unique<call_site_htab_t> (std::move (call_site_htab));
}
/* See symtab.h. */
compunit_symtab::~compunit_symtab ()
{
this->forget_cached_source_info ();
- delete m_call_site_htab;
}
/* The relocated address of the minimal symbol, using the section
unsigned int m_epilogue_unwind_valid : 1;
/* struct call_site entries for this compilation unit or NULL. */
- call_site_htab_t *m_call_site_htab = nullptr;
+ std::unique_ptr<call_site_htab_t> m_call_site_htab;
/* The macro table for this symtab. Like the blockvector, this
is shared between different symtabs in a given compilation unit.