cutu_reader *result = m_index_storage->get_reader (per_cu);
if (result == nullptr)
{
- cutu_reader new_reader (*per_cu, *per_objfile, nullptr, nullptr, false,
- language_minimal,
- &m_index_storage->get_abbrev_table_cache ());
-
- if (new_reader.is_dummy () || new_reader.top_level_die () == nullptr
- || !new_reader.top_level_die ()->has_children)
+ const abbrev_table_cache &abbrev_table_cache
+ = m_index_storage->get_abbrev_table_cache ();
+ auto new_reader
+ = std::make_unique<cutu_reader> (*per_cu, *per_objfile, nullptr,
+ nullptr, false, language_minimal,
+ &abbrev_table_cache);
+
+ if (new_reader->is_dummy () || new_reader->top_level_die () == nullptr
+ || !new_reader->top_level_die ()->has_children)
return nullptr;
- auto copy = std::make_unique<cutu_reader> (std::move (new_reader));
- result = m_index_storage->preserve (std::move (copy));
+ result = m_index_storage->preserve (std::move (new_reader));
}
if (result->is_dummy () || result->top_level_die () == nullptr
cutu_reader *reader = storage->get_reader (this_cu);
if (reader == nullptr)
{
- cutu_reader new_reader (*this_cu, *per_objfile, nullptr, nullptr, false,
- language_minimal,
- &storage->get_abbrev_table_cache ());
-
- if (new_reader.cu () == nullptr || new_reader.is_dummy ())
+ const abbrev_table_cache &abbrev_table_cache
+ = storage->get_abbrev_table_cache ();
+ auto new_reader = std::make_unique<cutu_reader> (*this_cu, *per_objfile,
+ nullptr, nullptr, false,
+ language_minimal,
+ &abbrev_table_cache);
+
+ if (new_reader->cu () == nullptr || new_reader->is_dummy ())
return;
- auto copy = std::make_unique<cutu_reader> (std::move (new_reader));
- reader = storage->preserve (std::move (copy));
+ reader = storage->preserve (std::move (new_reader));
}
if (reader->top_level_die () == nullptr || reader->is_dummy ())
DISABLE_COPY_AND_ASSIGN (cutu_reader);
- cutu_reader (cutu_reader &&) = default;
-
/* Return true if either:
- the unit is empty (just a header without any DIE)