static void
output_btf_func_types (ctf_container_ref ctfc)
{
- for (size_t i = 0; i < vec_safe_length (funcs); i++)
- btf_asm_func_type (ctfc, (*funcs)[i], i);
+ ctf_dtdef_ref ref;
+ unsigned i;
+ FOR_EACH_VEC_ELT (*funcs, i, ref)
+ btf_asm_func_type (ctfc, ref, i);
}
/* Output all BTF_KIND_DATASEC records. */
tu_ctfc = NULL;
}
+/* Traversal function for all BTF_KIND_FUNC type records. */
+
+bool
+traverse_btf_func_types (funcs_traverse_callback callback, void *data)
+{
+ ctf_dtdef_ref ref;
+ unsigned i;
+ FOR_EACH_VEC_ELT (*funcs, i, ref)
+ {
+ bool stop = callback (ref, data);
+ if (stop == true)
+ return true;
+ }
+ return false;
+}
+
#include "gt-btfout.h"
extern ctf_id_t ctf_lookup_tree_type (ctf_container_ref, const tree);
extern ctf_id_t get_btf_id (ctf_id_t);
+typedef bool (*funcs_traverse_callback) (ctf_dtdef_ref, void *);
+bool traverse_btf_func_types (funcs_traverse_callback, void *);
+
/* CTF section does not emit location information; at this time, location
information is needed for BTF CO-RE use-cases. */