mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-11-16 12:34:43 +00:00
Use std::unique_ptr in compunit_symtab
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>
This commit is contained in:
@@ -428,7 +428,8 @@ void
|
||||
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. */
|
||||
@@ -513,7 +514,6 @@ compunit_symtab::compunit_symtab (struct objfile *objfile,
|
||||
compunit_symtab::~compunit_symtab ()
|
||||
{
|
||||
this->forget_cached_source_info ();
|
||||
delete m_call_site_htab;
|
||||
}
|
||||
|
||||
/* The relocated address of the minimal symbol, using the section
|
||||
|
||||
@@ -2006,7 +2006,7 @@ struct compunit_symtab : intrusive_list_node<compunit_symtab>
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user