- hash table. A flat/vector-based map is more efficient than a map
- or hash table here, since this will only usually contain zero or
- one entries. */
- std::vector<enum language> demangled_hash_languages;
+ hash table. */
+ std::bitset<nr_languages> demangled_hash_languages;
+};
+
+/* An iterator that first returns a parent objfile, and then each
+ separate debug objfile. */
+
+class separate_debug_iterator
+{
+public:
+
+ explicit separate_debug_iterator (struct objfile *objfile)
+ : m_objfile (objfile),
+ m_parent (objfile)
+ {
+ }
+
+ bool operator!= (const separate_debug_iterator &other)
+ {
+ return m_objfile != other.m_objfile;
+ }
+
+ separate_debug_iterator &operator++ ();
+
+ struct objfile *operator* ()
+ {
+ return m_objfile;
+ }
+
+private:
+
+ struct objfile *m_objfile;
+ struct objfile *m_parent;
+};
+
+/* A range adapter wrapping separate_debug_iterator. */
+
+class separate_debug_range
+{
+public:
+
+ explicit separate_debug_range (struct objfile *objfile)
+ : m_objfile (objfile)
+ {
+ }
+
+ separate_debug_iterator begin ()
+ {
+ return separate_debug_iterator (m_objfile);
+ }
+
+ separate_debug_iterator end ()
+ {
+ return separate_debug_iterator (nullptr);
+ }
+
+private:
+
+ struct objfile *m_objfile;