Add compunits range adapter to objfile
[deliverable/binutils-gdb.git] / gdb / objfiles.h
index 599d8a1bce9cb682d3baa8547433660d64ad0b04..2cf61957ec1d1a3b534c0acbce71f045a24a653b 100644 (file)
@@ -301,6 +301,15 @@ struct objfile
     partial_symtabs.reset (new psymtab_storage ());
   }
 
+  typedef next_adapter<struct compunit_symtab> compunits_range;
+
+  /* A range adapter that makes it possible to iterate over all
+     compunits in one objfile.  */
+
+  compunits_range compunits ()
+  {
+    return compunits_range (compunit_symtabs);
+  }
 
   /* All struct objfile's are chained together by their next pointers.
      The program space field "objfiles"  (frequently referenced via
@@ -553,19 +562,6 @@ extern void default_iterate_over_objfiles_in_search_order
    void *cb_data, struct objfile *current_objfile);
 \f
 
-/* A range adapter that makes it possible to iterate over all
-   compunits in one objfile.  */
-
-class objfile_compunits : public next_adapter<struct compunit_symtab>
-{
-public:
-
-  explicit objfile_compunits (struct objfile *objfile)
-    : next_adapter<struct compunit_symtab> (objfile->compunit_symtabs)
-  {
-  }
-};
-
 /* A range adapter that makes it possible to iterate over all
    minimal symbols of an objfile.  */
 
This page took 0.026207 seconds and 4 git commands to generate.