]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libctf, API review: delete ctf_type_ischild()
authorNick Alcock <nick.alcock@oracle.com>
Mon, 10 Nov 2025 15:59:53 +0000 (15:59 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Tue, 9 Dec 2025 13:02:31 +0000 (13:02 +0000)
This is just !ctf_type_isparent().

include/ctf-api.h
libctf/ctf-inlines.h
libctf/ctf-types.c
libctf/libctf.ver

index f037e217f434eb222033e35f0a02b2ee12b9dca8..d4dd853b11bd58e1d75be2818d610cdabb83239f 100644 (file)
@@ -536,6 +536,9 @@ extern void ctf_dict_close (ctf_dict_t *);
    up already, but if opening via raw low-level calls, you need to figure
    out which dict is the parent and set it on the child via ctf_import().
 
+   To determine whether a CTF type is in a child, use !ctf_type_isparent().
+   (ctf_type_isparent cannot fail.)
+
    Almost all operations other than ctf_import and ctf_close do not work on
    child dicts that have not yet had ctf_import called on them; in particular,
    name lookups and type lookup in general are broken, as is type addition.  */
@@ -544,7 +547,6 @@ extern const char *ctf_cuname (ctf_dict_t *);
 extern ctf_dict_t *ctf_parent_dict (ctf_dict_t *);
 extern const char *ctf_parent_name (ctf_dict_t *);
 extern ctf_bool_t ctf_type_isparent (const ctf_dict_t *, ctf_id_t);
-extern ctf_bool_t ctf_type_ischild (const ctf_dict_t *, ctf_id_t);
 extern ctf_ret_t ctf_import (ctf_dict_t *child, ctf_dict_t *parent);
 
 /* Set these names (used when creating dicts).  */
index f6ba6967c4ac944600b9f9990b1308814ecf1c4f..081363eaf83da57b315047755b1a01ffce995791 100644 (file)
@@ -90,6 +90,12 @@ ctf_assert_internal (ctf_dict_t *fp, const char *file, size_t line,
   return expr;
 }
 
+static inline ctf_bool_t
+ctf_type_ischild (const ctf_dict_t *fp, ctf_id_t id)
+{
+  return (!ctf_type_isparent (fp, id));
+}
+
 /* Un-inline these functions if debugging, so you can drop breakpoints on the
    setting of any error anywhere by the library.  */
 
index 6cf0aa71e38ebc0badc7c6d8bf5fc13efbe4b4d3..8c9303551e3ea814219c62de43cf58d1969c9659 100644 (file)
@@ -59,12 +59,6 @@ ctf_type_isparent (const ctf_dict_t *fp, ctf_id_t id)
   return 0;
 }
 
-ctf_bool_t
-ctf_type_ischild (const ctf_dict_t *fp, ctf_id_t id)
-{
-  return (!ctf_type_isparent (fp, id));
-}
-
 /* Get the index in the internal type array (or otherwise) for a given type ID.
    Only ever called on the right dictionary for the type, and can fail otherwise.
    If called on an invalid type, may return an index that does not correspond to
index 70e4d3a05d5cfde763bcdca6f6941c886483fa50..1df2e1405b573869c88ae7106850768e5471e756 100644 (file)
@@ -35,7 +35,6 @@ LIBCTF_2.0 {
        ctf_parent_name_set;
        ctf_parent_dict;
        ctf_type_isparent;
-       ctf_type_ischild;
 
        ctf_import;
        ctf_setmodel;