Remove dwarf2_per_cu_data::objfile ()
[deliverable/binutils-gdb.git] / gdb / dwarf2 / abbrev.h
index df83c093be2768a4f48cf46ea13411faabd860f7..b9ace64b4482c808a405373845e362073168f3b8 100644 (file)
@@ -35,7 +35,6 @@ struct abbrev_info
     unsigned short has_children;               /* boolean */
     unsigned short num_attrs;  /* number of attributes */
     struct attr_abbrev *attrs; /* an array of attribute descriptions */
-    struct abbrev_info *next;  /* next in chain */
   };
 
 struct attr_abbrev
@@ -47,29 +46,16 @@ struct attr_abbrev
     LONGEST implicit_const;
   };
 
-/* Size of abbrev_table.abbrev_hash_table.  */
-#define ABBREV_HASH_SIZE 121
+struct abbrev_table;
+typedef std::unique_ptr<struct abbrev_table> abbrev_table_up;
 
 /* Top level data structure to contain an abbreviation table.  */
 
 struct abbrev_table
 {
-  explicit abbrev_table (sect_offset off)
-    : sect_off (off)
-  {
-    m_abbrevs =
-      XOBNEWVEC (&abbrev_obstack, struct abbrev_info *, ABBREV_HASH_SIZE);
-    memset (m_abbrevs, 0, ABBREV_HASH_SIZE * sizeof (struct abbrev_info *));
-  }
-
-  DISABLE_COPY_AND_ASSIGN (abbrev_table);
-
-  /* Allocate space for a struct abbrev_info object in
-     ABBREV_TABLE.  */
-  struct abbrev_info *alloc_abbrev ();
-
-  /* Add an abbreviation to the table.  */
-  void add_abbrev (unsigned int abbrev_number, struct abbrev_info *abbrev);
+  static abbrev_table_up read (struct objfile *objfile,
+                              struct dwarf2_section_info *section,
+                              sect_offset sect_off);
 
   /* Look up an abbrev in the table.
      Returns NULL if the abbrev is not found.  */
@@ -81,23 +67,24 @@ struct abbrev_table
      This is used as a sanity check when the table is used.  */
   const sect_offset sect_off;
 
-  /* Storage for the abbrev table.  */
-  auto_obstack abbrev_obstack;
-
 private:
 
-  /* Hash table of abbrevs.
-     This is an array of size ABBREV_HASH_SIZE allocated in abbrev_obstack.
-     It could be statically allocated, but the previous code didn't so we
-     don't either.  */
-  struct abbrev_info **m_abbrevs;
-};
+  explicit abbrev_table (sect_offset off);
 
-typedef std::unique_ptr<struct abbrev_table> abbrev_table_up;
+  DISABLE_COPY_AND_ASSIGN (abbrev_table);
+
+  /* Allocate space for a struct abbrev_info object in
+     ABBREV_TABLE.  */
+  struct abbrev_info *alloc_abbrev ();
 
-extern abbrev_table_up abbrev_table_read_table
-  (struct objfile *objfile,
-   struct dwarf2_section_info *section,
-   sect_offset sect_off);
+  /* Add an abbreviation to the table.  */
+  void add_abbrev (unsigned int abbrev_number, struct abbrev_info *abbrev);
+
+  /* Hash table of abbrevs.  */
+  htab_up m_abbrevs;
+
+  /* Storage for the abbrev table.  */
+  auto_obstack m_abbrev_obstack;
+};
 
 #endif /* GDB_DWARF2_ABBREV_H */
This page took 0.023672 seconds and 4 git commands to generate.