aboutsummaryrefslogtreecommitdiff
path: root/libctf/ctf-intl.h
diff options
context:
space:
mode:
authorNick Alcock <nick.alcock@oracle.com>2025-04-25 18:57:43 +0100
committerNick Alcock <nick.alcock@oracle.com>2025-04-25 21:23:07 +0100
commit95eb77bddb0da40e2e88dcbab8fae3538c100550 (patch)
tree9b390431fcd5b76cd313bc0500747b3f837609c8 /libctf/ctf-intl.h
parent81b9312ac407e47f6e64cbf0fc993d400c9eadd3 (diff)
downloadbinutils-95eb77bddb0da40e2e88dcbab8fae3538c100550.zip
binutils-95eb77bddb0da40e2e88dcbab8fae3538c100550.tar.gz
binutils-95eb77bddb0da40e2e88dcbab8fae3538c100550.tar.bz2
libctf: dedup: enums, enum64s, functions, func linkage
These are all fairly simple and are handled together because some of the diffs are annoyingly entwined. enum and enum64 are trivial: it's just like enums used to be, except that we hash in the unsignedness value, and emit signed or unsigned enums or enum64s appropriately. (The signedness stuff on the emission side is fairly invisible: it's automatically handled for us by ctf_type_encoding and ctf_add_enum*_encoded, via the CTF_INT_SIGNED encoding.) Functions are also fairly simple: we hash in all the parameter names as well as the args, and emit them accordingly. Linkage is more difficult. We want to deduplicate extern and non-extern declarations together, while leaving static ones separate. We do this by promoting extern linkage to global at hashing time, and maintaining a cd_linkages hashmap which maps from type hash values of func linkages (and vars) to the best linkage known so far, then updating it if a better one ("less extern") comes along (relying on the fact that we are already unifying the hashes of otherwise-identical extern and non-extern types). At emission time, we use this hashtab to figure out what linkage to emit.
Diffstat (limited to 'libctf/ctf-intl.h')
0 files changed, 0 insertions, 0 deletions