2012-04-26 Doug Evans * dwarf2read.c (die_hash, die_eq): Move definitions (prep work for Fission patch). Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.640 diff -u -p -r1.640 dwarf2read.c --- dwarf2read.c 26 Apr 2012 20:32:30 -0000 1.640 +++ dwarf2read.c 26 Apr 2012 22:06:12 -0000 @@ -4692,6 +4692,29 @@ psymtab_to_symtab_1 (struct partial_symt dw2_do_instantiate_symtab (per_cu); } +/* Trivial hash function for die_info: the hash value of a DIE + is its offset in .debug_info for this objfile. */ + +static hashval_t +die_hash (const void *item) +{ + const struct die_info *die = item; + + return die->offset.sect_off; +} + +/* Trivial comparison function for die_info structures: two DIEs + are equal if they have the same offset. */ + +static int +die_eq (const void *item_lhs, const void *item_rhs) +{ + const struct die_info *die_lhs = item_lhs; + const struct die_info *die_rhs = item_rhs; + + return die_lhs->offset.sect_off == die_rhs->offset.sect_off; +} + /* Load the DIEs associated with PER_CU into memory. */ static void @@ -9264,29 +9287,6 @@ read_unspecified_type (struct die_info * return set_die_type (die, type, cu); } -/* Trivial hash function for die_info: the hash value of a DIE - is its offset in .debug_info for this objfile. */ - -static hashval_t -die_hash (const void *item) -{ - const struct die_info *die = item; - - return die->offset.sect_off; -} - -/* Trivial comparison function for die_info structures: two DIEs - are equal if they have the same offset. */ - -static int -die_eq (const void *item_lhs, const void *item_rhs) -{ - const struct die_info *die_lhs = item_lhs; - const struct die_info *die_rhs = item_rhs; - - return die_lhs->offset.sect_off == die_rhs->offset.sect_off; -} - /* Read a whole compilation unit into a linked list of dies. */ static struct die_info *