From 68720e03f58f4c4565f5d8724742acc5951210fa Mon Sep 17 00:00:00 2001 From: Nick Alcock Date: Tue, 9 Jul 2024 15:30:39 +0100 Subject: 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-link.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libctf/ctf-link.c') diff --git a/libctf/ctf-link.c b/libctf/ctf-link.c index 801b6ee..42b2911 100644 --- a/libctf/ctf-link.c +++ b/libctf/ctf-link.c @@ -1242,7 +1242,7 @@ ctf_link_deduplicating_per_cu (ctf_dict_t *fp) dictionary. */ ctf_cuname_set (out, out_name); - if (ctf_dedup (out, inputs, ninputs, parents, 1) < 0) + if (ctf_dedup (out, inputs, ninputs, 1) < 0) { ctf_set_errno (fp, ctf_errno (out)); ctf_err_warn (fp, 0, 0, _("CU-mapped deduplication failed for %s"), @@ -1401,7 +1401,7 @@ ctf_link_deduplicating (ctf_dict_t *fp) if (ninputs == 1 && ctf_cuname (inputs[0]) != NULL) ctf_cuname_set (fp, ctf_cuname (inputs[0])); - if (ctf_dedup (fp, inputs, ninputs, parents, 0) < 0) + if (ctf_dedup (fp, inputs, ninputs, 0) < 0) { ctf_err_warn (fp, 0, 0, _("deduplication failed for %s"), ctf_link_input_name (fp)); -- cgit v1.1