diff options
author | Tom Tromey <tom@tromey.com> | 2021-12-22 10:30:16 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-12-29 10:24:05 -0700 |
commit | ba0084966cfee307631aba6d0f052a39ad773909 (patch) | |
tree | 63012fc81a9af3914b8f5368803dc52a76383b8f /gdb/gdbtypes.h | |
parent | 003aae076207dbf32f98ba846158fc32669ef85f (diff) | |
download | binutils-gdb-ba0084966cfee307631aba6d0f052a39ad773909.tar.gz |
Remove unusual use of core_addr_eq and core_addr_hash
gdbtypes.h uses core_addr_eq and core_addr_hash in a weird way: taking
the address of a member and then passing this (as a void*) to these
functions.
It seems better to simply inline the ordinary code here. CORE_ADDR is
a scalar so it can be directly compared, and the identity hash
function seems safe to assume as well.
After this, core_addr_eq and core_addr_hash are unused, so this patch
removes them.
Diffstat (limited to 'gdb/gdbtypes.h')
-rw-r--r-- | gdb/gdbtypes.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 5284a4c3a03..35549a84620 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1910,13 +1910,13 @@ struct call_site static int eq (const call_site *a, const call_site *b) { - return core_addr_eq (&a->m_unrelocated_pc, &b->m_unrelocated_pc); + return a->m_unrelocated_pc == b->m_unrelocated_pc; } static hashval_t hash (const call_site *a) { - return core_addr_hash (&a->m_unrelocated_pc); + return a->m_unrelocated_pc; } static int |