]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
libctf, dedup: drop unnecessary arg from ctf_dedup()
authorNick Alcock <nick.alcock@oracle.com>
Tue, 9 Jul 2024 14:30:39 +0000 (15:30 +0100)
committerNick Alcock <nick.alcock@oracle.com>
Thu, 1 Aug 2024 13:30:20 +0000 (14:30 +0100)
commit5d64742afad6763f2b6b2e5ddb35b51e628cffd9
treedb1c4f9ba082640fe36d8f377f609d022145f077
parentcc7069a8c89a58eb97222fe78129a120ce8f01d2
libctf, dedup: drop unnecessary arg from ctf_dedup()

The PARENTS arg is carefully passed down through all the layers of hash
functions and then never used for anything.  (In the distant past it was
used for cycle detection, but the algorithm eventually committed doesn't
need to do cycle detection...)

The PARENTS arg is still used by ctf_dedup_emit(), but even there we can
loosen the requirements and state that you can just leave entries
corresponding to dicts with no parents at zero (which will be useful
in an upcoming commit).

libctf/
* ctf-dedup.c (ctf_dedup_hash_type): Drop PARENTS arg.
(ctf_dedup_rhash_type): Likewise.
(ctf_dedup): Likewise.
(ctf_dedup_emit_struct_members): Mention what you can do to
        PARENTS entries for parent dicts.
* ctf-impl.h (ctf_dedup): Adjust accordingly.
* ctf-link.c (ctf_link_deduplicating_per_cu): Likewise.
(ctf_link_deduplicating): Likewise.
libctf/ctf-dedup.c
libctf/ctf-impl.h
libctf/ctf-link.c