- return (per_cu->dwarf2_per_objfile->using_index
- ? per_cu->v.quick->compunit_symtab
- : per_cu->v.psymtab->compunit_symtab);
+ auto iter = this->m_type_units.find (tu_group);
+ if (iter != this->m_type_units.end ())
+ return iter->second.get ();
+
+ type_unit_group_unshareable_up uniq (new type_unit_group_unshareable);
+ type_unit_group_unshareable *result = uniq.get ();
+ this->m_type_units[tu_group] = std::move (uniq);
+ return result;
+}
+
+struct type *
+dwarf2_per_objfile::get_type_for_signatured_type
+ (signatured_type *sig_type) const
+{
+ auto iter = this->m_type_map.find (sig_type);
+ if (iter == this->m_type_map.end ())
+ return nullptr;
+
+ return iter->second;
+}
+
+void dwarf2_per_objfile::set_type_for_signatured_type
+ (signatured_type *sig_type, struct type *type)
+{
+ gdb_assert (this->m_type_map.find (sig_type) == this->m_type_map.end ());
+
+ this->m_type_map[sig_type] = type;