macro.c: use string hash from hash.h for macro_hash
authorAlan Modra <amodra@gmail.com>
Wed, 6 Jul 2022 23:07:10 +0000 (08:37 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 9 Jul 2022 11:51:36 +0000 (21:21 +0930)
commitbdcc1de1ecfabc7d2560aa56cbe5425cb43e9cac
tree052d9411ca4a306644e193dfbcd5dfee99049291
parentd1cffdc3644b21187c3709ae3c9c757f9d59558e
macro.c: use string hash from hash.h for macro_hash

Another case of duplicated hash.h code, the only minor difference
being that macro->format_hash was created with 7 entries vs. str_hash
with 16 entries.

* macro.c (macro_init, define_macro): Use str_htab_create.
(do_formals, define_macro, macro_expand_body): Use str_hash_insert
(macro_expand_body): Use str_hash_find and str_hash_delete.
(delete_macro): Likewise.
(sub_actual, macro_expand, check_macro): Use str_hash_find.
(expand_irp): Use str_htab_create and str_hash_insert.
* macro.h (struct macro_struct): Tidy.
(struct macro_hash_entry, macro_hash_entry_t, hash_macro_entry),
(eq_macro_entry, macro_entry_alloc, macro_entry_find),
(struct formal_hash_entry, formal_hash_entry_t),
(hash_formal_entry, eq_formal_entry, formal_entry_alloc),
(formal_entry_find): Delete.
* config/tc-iq2000.c (iq2000_add_macro): Use str_htab_create
and str_hash_insert.
gas/config/tc-iq2000.c
gas/macro.c
gas/macro.h