diff options
author | Nick Alcock <nick.alcock@oracle.com> | 2025-01-29 12:30:58 +0000 |
---|---|---|
committer | Nick Alcock <nick.alcock@oracle.com> | 2025-02-28 15:13:24 +0000 |
commit | b875301e748200429b92303fa0f2a754ff9d439f (patch) | |
tree | 66d033eb6c490ca3b8758e016400d71b7766816c /libctf/ctf-dedup.c | |
parent | 9835747b21aa065804d3bdcf37a5dbb88ac46992 (diff) | |
download | binutils-b875301e748200429b92303fa0f2a754ff9d439f.zip binutils-b875301e748200429b92303fa0f2a754ff9d439f.tar.gz binutils-b875301e748200429b92303fa0f2a754ff9d439f.tar.bz2 |
libctf: drop LCTF_TYPE_ISPARENT/LCTF_TYPE_ISCHILD
Parent/child determination is about to become rather more complex, making a
macro impractical. Use the ctf_type_isparent/ischild function calls
everywhere and remove the macro. Make them more const-correct too, to
make them more widely usable.
While we're about it, change several places that hand-implemented
ctf_get_dict() to call it instead, and armour several functions against
the null returns that were always possible in this case (but previously
unprotected-against).
Diffstat (limited to 'libctf/ctf-dedup.c')
-rw-r--r-- | libctf/ctf-dedup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libctf/ctf-dedup.c b/libctf/ctf-dedup.c index e7fcd22..76f9709 100644 --- a/libctf/ctf-dedup.c +++ b/libctf/ctf-dedup.c @@ -2087,7 +2087,7 @@ ctf_dedup_rwalk_one_output_mapping (ctf_dict_t *output, const char *hashval; \ int cited_type_input_num = input_num; \ \ - if ((fp->ctf_flags & LCTF_CHILD) && (LCTF_TYPE_ISPARENT (fp, type))) \ + if ((fp->ctf_flags & LCTF_CHILD) && (ctf_type_isparent (fp, type))) \ cited_type_input_num = parents[input_num]; \ \ type_id = CTF_DEDUP_GID (output, cited_type_input_num, type); \ @@ -2549,7 +2549,7 @@ ctf_dedup_id_to_target (ctf_dict_t *output, ctf_dict_t *target, /* If the input type is in the parent type space, and this is a child, reset the input to the parent (which must already have been emitted, since emission of parent dicts happens before children). */ - if ((input->ctf_flags & LCTF_CHILD) && (LCTF_TYPE_ISPARENT (input, id))) + if ((input->ctf_flags & LCTF_CHILD) && (ctf_type_isparent (input, id))) { if (!ctf_assert (output, parents[input_num] <= ninputs)) return CTF_ERR; |