- /* We found a non-root-visible type in the hash. We reset
- dst_type to ensure that we continue to look for a possible
- conflict in the pending list. */
-
- dst_type = CTF_ERR;
- }
- }
- }
-
- /* If the non-empty name was not found in the appropriate hash, search
- the list of pending dynamic definitions that are not yet committed.
- If a matching name and kind are found, assume this is the type that
- we are looking for. This is necessary to permit ctf_add_type() to
- operate recursively on entities such as a struct that contains a
- pointer member that refers to the same struct type. */
-
- if (dst_type == CTF_ERR && name[0] != '\0')
- {
- for (dtd = ctf_list_prev (&dst_fp->ctf_dtdefs); dtd != NULL
- && LCTF_TYPE_TO_INDEX (src_fp, dtd->dtd_type) > dst_fp->ctf_dtoldid;
- dtd = ctf_list_prev (dtd))
- {
- if (LCTF_INFO_KIND (src_fp, dtd->dtd_data.ctt_info) == kind
- && dtd->dtd_name != NULL && strcmp (dtd->dtd_name, name) == 0)
- {
- int sroot; /* Is the src root-visible? */
- int droot; /* Is the dst root-visible? */
- int match; /* Do the encodings match? */
-
- if (kind != CTF_K_INTEGER && kind != CTF_K_FLOAT && kind != CTF_K_SLICE)
- return dtd->dtd_type;
+ /* We found a non-root-visible type in the hash. If its encoding
+ is the same, we can reuse it, unless it is a slice. */