diff options
author | David Carlton <carlton@bactrian.org> | 2003-06-11 22:27:17 +0000 |
---|---|---|
committer | David Carlton <carlton@bactrian.org> | 2003-06-11 22:27:17 +0000 |
commit | 526e70c05f9132dc0a15af67943d2ecf9120660e (patch) | |
tree | 45a01e57386fa45d0b48c6a524a250ff68fb22b5 /gdb/ada-lang.c | |
parent | 33c081509ef98f9ea2702cb8e6150e0bbf277ab2 (diff) | |
download | gdb-526e70c05f9132dc0a15af67943d2ecf9120660e.zip gdb-526e70c05f9132dc0a15af67943d2ecf9120660e.tar.gz gdb-526e70c05f9132dc0a15af67943d2ecf9120660e.tar.bz2 |
2003-06-11 David Carlton <carlton@bactrian.org>
* block.h (BLOCK_SHOULD_SORT): Delete.
* symtab.c (lookup_block_symbol): Don't worry about sorted linear
blocks.
* ada-lang.c (ada_add_block_symbols): Ditto.
* symfile.c (sort_block_syms): Delete.
(sort_symtab_syms): Ditto.
* symfile.h: Delete sort_symtabs_syms and sort_block_syms
declarations.
* coffread.c (coff_symfile_read): Don't call sort_symtab_syms.
* dbxread.c (dbx_psymtab_to_symtab_1): Ditto.
* dwarf2read.c (psymtab_to_symtab_1): Ditto.
* dwarfread.c (psymtab_to_symtab_1): Ditto.
* hpread.c (hpread_psymtab_to_symtab_1): Ditto.
* mdebugread.c (psymtab_to_symtab_1): Ditto.
* xcoffread.c (xcoff_psymtab_to_symtab_1): Ditto.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 74 |
1 files changed, 6 insertions, 68 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index c403af2..a37ed69 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -3953,7 +3953,6 @@ ada_add_block_symbols (struct block *block, const char *name, struct symbol *arg_sym; /* Set true when we find a matching non-argument symbol */ int found_sym; - int is_sorted = BLOCK_SHOULD_SORT (block); struct symbol *sym; arg_sym = NULL; @@ -3990,45 +3989,14 @@ ada_add_block_symbols (struct block *block, const char *name, } else { - if (is_sorted) - { - int U; - i = 0; - U = BLOCK_NSYMS (block) - 1; - while (U - i > 4) - { - int M = (U + i) >> 1; - struct symbol *sym = BLOCK_SYM (block, M); - if (DEPRECATED_SYMBOL_NAME (sym)[0] < name[0]) - i = M + 1; - else if (DEPRECATED_SYMBOL_NAME (sym)[0] > name[0]) - U = M - 1; - else if (strcmp (DEPRECATED_SYMBOL_NAME (sym), name) < 0) - i = M + 1; - else - U = M; - } - } - else - i = 0; - - for (; i < BLOCK_BUCKETS (block); i += 1) - for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next) + ALL_BLOCK_SYMBOLS (block, i, sym) { if (SYMBOL_DOMAIN (sym) == domain) { int cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym), name_len); - if (cmp < 0) - { - if (is_sorted) - { - i = BLOCK_BUCKETS (block); - break; - } - } - else if (cmp == 0 - && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len)) + if (cmp == 0 + && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len)) { switch (SYMBOL_CLASS (sym)) { @@ -4065,30 +4033,8 @@ ada_add_block_symbols (struct block *block, const char *name, { arg_sym = NULL; found_sym = 0; - if (is_sorted) - { - int U; - i = 0; - U = BLOCK_NSYMS (block) - 1; - while (U - i > 4) - { - int M = (U + i) >> 1; - struct symbol *sym = BLOCK_SYM (block, M); - if (DEPRECATED_SYMBOL_NAME (sym)[0] < '_') - i = M + 1; - else if (DEPRECATED_SYMBOL_NAME (sym)[0] > '_') - U = M - 1; - else if (strcmp (DEPRECATED_SYMBOL_NAME (sym), "_ada_") < 0) - i = M + 1; - else - U = M; - } - } - else - i = 0; - for (; i < BLOCK_BUCKETS (block); i += 1) - for (sym = BLOCK_BUCKET (block, i); sym != NULL; sym = sym->hash_next) + ALL_BLOCK_SYMBOLS (block, i, sym) { struct symbol *sym = BLOCK_SYM (block, i); @@ -4104,16 +4050,8 @@ ada_add_block_symbols (struct block *block, const char *name, cmp = strncmp (name, DEPRECATED_SYMBOL_NAME (sym) + 5, name_len); } - if (cmp < 0) - { - if (is_sorted) - { - i = BLOCK_BUCKETS (block); - break; - } - } - else if (cmp == 0 - && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len + 5)) + if (cmp == 0 + && is_name_suffix (DEPRECATED_SYMBOL_NAME (sym) + name_len + 5)) { switch (SYMBOL_CLASS (sym)) { |