diff options
author | Lawrence Crowl <crowl@google.com> | 2013-05-30 01:26:05 +0000 |
---|---|---|
committer | Lawrence Crowl <crowl@gcc.gnu.org> | 2013-05-30 01:26:05 +0000 |
commit | 3a4f280bec545db82380fb4cbc704ac7af438585 (patch) | |
tree | 5340933f027915d0e1c1ab4f652bfad732bb71ff /gcc/config/arm | |
parent | 4974c14ccc9b0e97afb69aeeb657a29bd35876b0 (diff) | |
download | gcc-3a4f280bec545db82380fb4cbc704ac7af438585.zip gcc-3a4f280bec545db82380fb4cbc704ac7af438585.tar.gz gcc-3a4f280bec545db82380fb4cbc704ac7af438585.tar.bz2 |
This patch is a consolodation of the hash_table patches to the
cxx-conversion branch for files under gcc/config.
Update various hash tables from htab_t to hash_table.
Modify types and calls to match.
* config/arm/arm.c'arm_libcall_uses_aapcs_base::libcall_htab
Fold libcall_eq and libcall_hash into new struct libcall_hasher.
* config/ia64/ia64.c'bundle_state_table
Fold bundle_state_hash and bundle_state_eq_p into new struct
bundle_state_hasher.
* config/mips/mips.c'mips_offset_table
Fold mips_lo_sum_offset_hash and mips_lo_sum_offset_eq into new
struct mips_lo_sum_offset_hasher.
In mips_reorg_process_insns, change call to for_each_rtx to pass
a pointer to the hash_table rather than a htab_t. This change
requires then dereferencing that pointer in mips_record_lo_sum to
obtain the hash_table.
* config/sol2.c'solaris_comdat_htab
Fold comdat_hash and comdat_eq into new struct comdat_entry_hasher.
* config/i386/winnt.c'i386_pe_section_type_flags::htab
* config/i386/winnt.c'i386_find_on_wrapper_list::wrappers
Fold wrapper_strcmp into new struct wrapped_symbol_hasher.
Tested on x86_64. Tested with config-list.mk.
Index: gcc/ChangeLog
2013-05-29 Lawrence Crowl <crowl@google.com>
* config/arm/t-arm: Update for below.
* config/arm/arm.c (arm_libcall_uses_aapcs_base::libcall_htab):
Change type to hash_table. Update dependent calls and types.
* config/i386/t-cygming: Update for below.
* config/i386/t-interix: Update for below.
* config/i386/winnt.c (i386_pe_section_type_flags::htab):
Change type to hash_table. Update dependent calls and types.
(i386_find_on_wrapper_list::wrappers): Likewise.
* config/ia64/t-ia64: Update for below.
* config/ia64/ia64.c (bundle_state_table):
Change type to hash_table. Update dependent calls and types.
* config/mips/mips.c (mips_reorg_process_insns::htab):
Change type to hash_table. Update dependent calls and types.
* config/sol2.c (solaris_comdat_htab):
Change type to hash_table. Update dependent calls and types.
* config/t-sol2: Update for above.
From-SVN: r199435
Diffstat (limited to 'gcc/config/arm')
-rw-r--r-- | gcc/config/arm/arm.c | 37 | ||||
-rw-r--r-- | gcc/config/arm/t-arm | 4 |
2 files changed, 27 insertions, 14 deletions
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index 43dfe27..9f0f2a8 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -23,6 +23,7 @@ #include "config.h" #include "system.h" #include "coretypes.h" +#include "hash-table.h" #include "tm.h" #include "rtl.h" #include "tree.h" @@ -3816,36 +3817,48 @@ arm_function_value(const_tree type, const_tree func, return arm_libcall_value_1 (mode); } -static int -libcall_eq (const void *p1, const void *p2) +/* libcall hashtable helpers. */ + +struct libcall_hasher : typed_noop_remove <rtx_def> +{ + typedef rtx_def value_type; + typedef rtx_def compare_type; + static inline hashval_t hash (const value_type *); + static inline bool equal (const value_type *, const compare_type *); + static inline void remove (value_type *); +}; + +inline bool +libcall_hasher::equal (const value_type *p1, const compare_type *p2) { - return rtx_equal_p ((const_rtx) p1, (const_rtx) p2); + return rtx_equal_p (p1, p2); } -static hashval_t -libcall_hash (const void *p1) +inline hashval_t +libcall_hasher::hash (const value_type *p1) { - return hash_rtx ((const_rtx) p1, VOIDmode, NULL, NULL, FALSE); + return hash_rtx (p1, VOIDmode, NULL, NULL, FALSE); } +typedef hash_table <libcall_hasher> libcall_table_type; + static void -add_libcall (htab_t htab, rtx libcall) +add_libcall (libcall_table_type htab, rtx libcall) { - *htab_find_slot (htab, libcall, INSERT) = libcall; + *htab.find_slot (libcall, INSERT) = libcall; } static bool arm_libcall_uses_aapcs_base (const_rtx libcall) { static bool init_done = false; - static htab_t libcall_htab; + static libcall_table_type libcall_htab; if (!init_done) { init_done = true; - libcall_htab = htab_create (31, libcall_hash, libcall_eq, - NULL); + libcall_htab.create (31); add_libcall (libcall_htab, convert_optab_libfunc (sfloat_optab, SFmode, SImode)); add_libcall (libcall_htab, @@ -3904,7 +3917,7 @@ arm_libcall_uses_aapcs_base (const_rtx libcall) DFmode)); } - return libcall && htab_find (libcall_htab, libcall) != NULL; + return libcall && libcall_htab.find (libcall) != NULL; } static rtx diff --git a/gcc/config/arm/t-arm b/gcc/config/arm/t-arm index fe075e5..246f0f5 100644 --- a/gcc/config/arm/t-arm +++ b/gcc/config/arm/t-arm @@ -78,8 +78,8 @@ $(srcdir)/config/arm/arm-tables.opt: $(srcdir)/config/arm/genopt.sh \ $(SHELL) $(srcdir)/config/arm/genopt.sh $(srcdir)/config/arm > \ $(srcdir)/config/arm/arm-tables.opt -arm.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ - $(RTL_H) $(TREE_H) $(OBSTACK_H) $(REGS_H) hard-reg-set.h \ +arm.o: $(srcdir)/config/arm/arm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \ + $(RTL_H) $(TREE_H) $(HASH_TABLE_H) $(OBSTACK_H) $(REGS_H) hard-reg-set.h \ insn-config.h conditions.h output.h dumpfile.h \ $(INSN_ATTR_H) $(FLAGS_H) reload.h $(FUNCTION_H) \ $(EXPR_H) $(OPTABS_H) $(RECOG_H) $(CGRAPH_H) \ |